dependency

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBroker added in v1.0.4

func GetBroker(brokerType types.Worker) interfaces.Broker

GetBroker free function for get broker

func GetExtended added in v1.0.4

func GetExtended(key string) interface{}

GetExtended free function for get extended

func GetKey added in v1.0.4

func GetKey() interfaces.RSAKey

GetKey free function for get key (RSA)

func GetLocker added in v1.14.8

func GetLocker() interfaces.Locker

GetLocker free function for get validator

func GetMiddleware added in v1.0.4

func GetMiddleware() interfaces.Middleware

GetMiddleware free function for get middleware

func GetMongoDatabase added in v1.0.4

func GetMongoDatabase() interfaces.MongoDatabase

GetMongoDatabase free function for get mongo database

func GetRedisPool added in v1.0.4

func GetRedisPool() interfaces.RedisPool

GetRedisPool free function for get redis pool

func GetSQLDatabase added in v1.0.4

func GetSQLDatabase() interfaces.SQLDatabase

GetSQLDatabase free function for get sql database

func GetValidator added in v1.0.4

func GetValidator() interfaces.Validator

GetValidator free function for get validator

Types

type Dependency

type Dependency interface {
	GetMiddleware() interfaces.Middleware
	SetMiddleware(mw interfaces.Middleware)

	GetBroker(types.Worker) interfaces.Broker
	AddBroker(brokerType types.Worker, b interfaces.Broker)

	GetSQLDatabase() interfaces.SQLDatabase
	GetMongoDatabase() interfaces.MongoDatabase
	GetRedisPool() interfaces.RedisPool

	GetKey() interfaces.RSAKey
	SetKey(i interfaces.RSAKey)

	GetValidator() interfaces.Validator
	SetValidator(v interfaces.Validator)

	GetLocker() interfaces.Locker
	SetLocker(v interfaces.Locker)

	GetExtended(key string) interface{}
	AddExtended(key string, value interface{})
}

Dependency base

func InitDependency

func InitDependency(opts ...Option) Dependency

InitDependency constructor

type Option

type Option func(*deps)

Option func type

func AddExtended added in v1.0.4

func AddExtended(key string, value interface{}) Option

AddExtended option function for add extended

func SetBrokers added in v1.7.0

func SetBrokers(brokers map[types.Worker]interfaces.Broker) Option

SetBrokers option func

func SetExtended

func SetExtended(ext map[string]interface{}) Option

SetExtended option func

func SetKey

func SetKey(key interfaces.RSAKey) Option

SetKey option func

func SetLocker added in v1.14.8

func SetLocker(lock interfaces.Locker) Option

SetLocker option func

func SetMiddleware

func SetMiddleware(mw interfaces.Middleware) Option

SetMiddleware option func

func SetMongoDatabase

func SetMongoDatabase(db interfaces.MongoDatabase) Option

SetMongoDatabase option func

func SetRedisPool

func SetRedisPool(db interfaces.RedisPool) Option

SetRedisPool option func

func SetSQLDatabase

func SetSQLDatabase(db interfaces.SQLDatabase) Option

SetSQLDatabase option func

func SetValidator

func SetValidator(validator interfaces.Validator) Option

SetValidator option func

Jump to

Keyboard shortcuts

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