⚙️ Core module shared across our backend projects
Adding core to a Go project is as easy as calling this command
go get github.com/cozy-hosting/core
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()
}
The list of uber/fx modules that are currently available:
- Logrus - https://github.com/sirupsen/logrus
- Clerk database (MongoDB) - https://github.com/cozy-hosting/clerk
- Messenger messaging queue (RabbitMQ) - https://github.com/cozy-hosting/messenger
- Labstack Echo webserver - https://github.com/labstack/echo
- Swagger UI trough swag - https://github.com/swaggo/swag
- GraphQL Schema / Handling - https://github.com/graphql-go/graphql