core

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2021 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

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:

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClerkModule = fx.Provide(
	NewClerkConnection,
)
View Source
var EchoModule = fx.Provide(
	UseEcho,
)
View Source
var GraphQlModule = fx.Provide(
	fx.Annotated{
		Name:   "query",
		Target: newGraphQlQuery,
	},
	fx.Annotated{
		Name:   "mutation",
		Target: newGraphQlMutation,
	},
	newGraphQlSchema,
)
View Source
var LogrusModule = fx.Provide(
	UseLogrus,
)
View Source
var MessengerModule = fx.Provide(
	newMessenger,
)

Functions

func IsDevelopment

func IsDevelopment() bool

func NewClerkConnection

func NewClerkConnection(lifecycle fx.Lifecycle, logger *logrus.Logger) clerk.Connection

func UseEcho

func UseEcho(lifecycle fx.Lifecycle, logger *logrus.Logger) *echo.Echo

func UseEnvironment

func UseEnvironment(logger *logrus.Logger)

func UseGraphQl

func UseGraphQl(schema *graphql.Schema, server *echo.Echo, logger *logrus.Logger)

func UseGraphQlWithPlayground

func UseGraphQlWithPlayground(schema *graphql.Schema, server *echo.Echo, logger *logrus.Logger)

func UseLogrus

func UseLogrus() *logrus.Logger

func UseSwagger

func UseSwagger(server *echo.Echo)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址