Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 1.18 KB

README.md

File metadata and controls

45 lines (34 loc) · 1.18 KB

core

⚙️ Core module shared across our backend projects

Installation

Adding core to a Go project is as easy as calling this command

go get github.com/cozy-hosting/core

Using the module

The project must be based on the uber-go/fx application framework

package main

import "go.uber.org/fx"

func main() {
    // Creates a new fx application
    fx.New(
        // Add the core module to the container
        core.Module,
        fx.Invoke(
            // Add this, if you want to use SwaggerUI
            core.UseSwagger,
            // Also add this, if you want to use GraphQL + Playground
            core.UseGraphQlWithPlayground,
        ),
    ).Run()
}

Contained sub-modules

The list of uber/fx modules that are currently available: