service

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppService              = "app"
	ConfigService           = "config"
	ErrorLoggerService      = "error_logger"
	JWTService              = "jwt"
	DDOSService             = "ddos"
	ORMConfigService        = "orm_config"
	ORMEngineGlobalService  = "orm_engine_global"
	ORMEngineRequestService = "orm_engine_request"
	OSSGoogleService        = "oss_google"
	PasswordService         = "password"
	SlackAPIService         = "slack_api"
	SocketRegistryService   = "socket_registry"
	APILoggerService        = "api_logger"
	AuthenticationService   = "authentication"
	ClockService            = "clock"
)
View Source
const (
	GinKey key = iota
)

Variables

This section is empty.

Functions

func GetContainerFromRequest

func GetContainerFromRequest(ctx context.Context) (ctn di.Container)

func GetServiceForRequestOptional

func GetServiceForRequestOptional(ctx context.Context, key string) (service interface{}, has bool)

func GetServiceForRequestRequired

func GetServiceForRequestRequired(ctx context.Context, key string) interface{}

func GetServiceForRequestSafe

func GetServiceForRequestSafe(ctx context.Context, key string) (service interface{}, has bool, err error)

func GetServiceOptional

func GetServiceOptional(key string) (service interface{}, has bool)

func GetServiceRequired

func GetServiceRequired(key string) interface{}

func GetServiceSafe

func GetServiceSafe(key string) (service interface{}, has bool, err error)

func HasService

func HasService(key string) bool

func SetContainer

func SetContainer(c di.Container)

Types

type DIInterface

type DIInterface interface {
	App() *app.App
	Config() *config.Config
	OrmConfig() (orm.ValidatedRegistry, bool)
	OrmEngine() (*orm.Engine, bool)
	OrmEngineForContext(ctx context.Context) (*orm.Engine, bool)
	JWT() (*jwt.JWT, bool)
	Password() (*password.Password, bool)
	SlackAPI() (*slackapi.SlackAPI, bool)
	ErrorLogger() (errorlogger.ErrorLogger, bool)
	OSSGoogle() (oss.Client, bool)
	SocketRegistry() (*socket.Registry, bool)
	APILoggerService() (apilogger.APILogger, bool)
	AuthenticationService() (*authentication.Authentication, bool)
}

func DI

func DI() DIInterface

type Definition

type Definition struct {
	Name   string
	Global bool
	Script bool
	Build  func(ctn di.Container) (interface{}, error)
	Close  func(obj interface{}) error
	Flags  func(registry *app.FlagsRegistry)
}

Jump to

Keyboard shortcuts

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