service

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GinKey key = iota
	RequestBodyKey
)
View Source
const (
	AppService              = "app"
	ConfigService           = "config"
	ErrorLoggerService      = "error_logger"
	LocalizeService         = "localize"
	PDFService              = "pdf"
	ExtractorService        = "extractor"
	JWTService              = "jwt"
	DDOSService             = "ddos"
	FCMService              = "fcm"
	ORMConfigService        = "orm_config"
	ORMEngineGlobalService  = "orm_engine_global"
	ORMEngineRequestService = "orm_engine_request"
	OSSGoogleService        = "oss_google"
	PasswordService         = "password"
	SlackService            = "slack"
	AmazonS3Service         = "amazon_s3"
	UploaderService         = "uploader"
	StripeService           = "stripe"
	CheckoutService         = "checkout"
	DynamicLinkService      = "dynamic_link"
	SocketRegistryService   = "socket_registry"
	APILoggerService        = "api_logger"
	AuthenticationService   = "authentication"
	ClockService            = "clock"
	SMSService              = "sms"
	GoroutineService        = "goroutine"
	GeneratorService        = "generator"
	MailMandrillService     = "mail_mandrill"
	GoogleService           = "google"
	FacebookService         = "facebook"
	CrudService             = "crud"
	UUIDService             = "uuid"
	OTPService              = "otp"
)

Variables

This section is empty.

Functions

func GetServiceForRequestRequired

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

func GetServiceFromRequest added in v0.8.35

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

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 GinFromContext added in v0.3.1

func GinFromContext(ctx context.Context) *gin.Context

func HasService

func HasService(key string) bool

func SetContainer

func SetContainer(c di.Container)

func SetRequestServices added in v0.8.35

func SetRequestServices(servicesDefinitionsRequest []*DefinitionRequest)

Types

type DIInterface

type DIInterface interface {
	App() *app.App
	Config() config.IConfig
	OrmConfig() (beeorm.ValidatedRegistry, bool)
	OrmEngine() (*beeorm.Engine, bool)
	OrmEngineForContext(ctx context.Context) *beeorm.Engine
	JWT() (*jwt.JWT, bool)
	Password() (password.IPassword, bool)
	Slack() (slack.Slack, bool)
	ErrorLogger() (errorlogger.ErrorLogger, bool)
	OSSGoogle() (oss.Client, bool)
	AmazonS3() (s3.Client, bool)
	SocketRegistry() (*socket.Registry, bool)
	APILogger() (apilogger.IAPILogger, bool)
	Authentication() (*authentication.Authentication, bool)
	SMS() (sms.ISender, bool)
	Generator() (generator.IGenerator, bool)
	MailMandrill() mail.Sender
	Stripe() (stripe.IStripe, bool)
	Google() *social.Google
	Checkout() (checkout.ICheckout, bool)
	Clock() clock.IClock
	Uploader() (uploader.Uploader, bool)
	CrudService() *crud.Crud
	Localize() localize.ILocalizer
	FileExtractor() *fileextractor.FileExtractor
	Goroutine() goroutine.IGoroutine
	UUID() uuid.IUUID
	OTP() otp.IOTP
}

func DI

func DI() DIInterface

type DefinitionGlobal added in v0.8.35

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

type DefinitionRequest added in v0.8.35

type DefinitionRequest struct {
	Name  string
	Build func(ctn *gin.Context) (interface{}, error)
}

Jump to

Keyboard shortcuts

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