Documentation ¶
Index ¶
- func GetBroker(brokerType types.Worker) interfaces.Broker
- func GetExtended(key string) any
- func GetKey() interfaces.RSAKey
- func GetLocker() interfaces.Locker
- func GetMiddleware() interfaces.Middleware
- func GetMongoDatabase() interfaces.MongoDatabase
- func GetMongoDatabaseByKey(key string) interfaces.MongoDatabase
- func GetRedisPool() interfaces.RedisPool
- func GetRedisPoolByKey(key string) interfaces.RedisPool
- func GetSQLDatabase() interfaces.SQLDatabase
- func GetSQLDatabaseByKey(key string) interfaces.SQLDatabase
- func GetValidator() interfaces.Validator
- type Dependency
- type Option
- func AddExtended(key string, value any) Option
- func AddMongoDatabase(key string, db interfaces.MongoDatabase) Option
- func AddRedisPool(key string, db interfaces.RedisPool) Option
- func AddSQLDatabase(key string, db interfaces.SQLDatabase) Option
- func SetBrokers(brokers map[types.Worker]interfaces.Broker) Option
- func SetExtended(ext map[string]any) Option
- func SetKey(key interfaces.RSAKey) Option
- func SetLocker(lock interfaces.Locker) Option
- func SetMiddleware(mw interfaces.Middleware) Option
- func SetMongoDatabase(db interfaces.MongoDatabase) Option
- func SetRedisPool(db interfaces.RedisPool) Option
- func SetSQLDatabase(db interfaces.SQLDatabase) Option
- func SetValidator(validator interfaces.Validator) Option
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 public function for get broker
func GetExtended ¶ added in v1.0.4
GetExtended public function for get extended
func GetKey ¶ added in v1.0.4
func GetKey() interfaces.RSAKey
GetKey public function for get key (RSA)
func GetLocker ¶ added in v1.14.8
func GetLocker() interfaces.Locker
GetLocker public function for get validator
func GetMiddleware ¶ added in v1.0.4
func GetMiddleware() interfaces.Middleware
GetMiddleware public function for get middleware
func GetMongoDatabase ¶ added in v1.0.4
func GetMongoDatabase() interfaces.MongoDatabase
GetMongoDatabase public function for get mongo database
func GetMongoDatabaseByKey ¶ added in v1.18.0
func GetMongoDatabaseByKey(key string) interfaces.MongoDatabase
GetMongoDatabaseByKey public function for get mongo db by key
func GetRedisPool ¶ added in v1.0.4
func GetRedisPool() interfaces.RedisPool
GetRedisPool public function for get redis pool
func GetRedisPoolByKey ¶ added in v1.18.0
func GetRedisPoolByKey(key string) interfaces.RedisPool
GetRedisPoolByKey public function for get redis pool by key
func GetSQLDatabase ¶ added in v1.0.4
func GetSQLDatabase() interfaces.SQLDatabase
GetSQLDatabase public function for get sql database
func GetSQLDatabaseByKey ¶ added in v1.18.0
func GetSQLDatabaseByKey(key string) interfaces.SQLDatabase
GetSQLDatabaseByKey public function for get sql db by key
func GetValidator ¶ added in v1.0.4
func GetValidator() interfaces.Validator
GetValidator public function for get validator
Types ¶
type Dependency ¶
type Dependency interface { GetMiddleware() interfaces.Middleware SetMiddleware(mw interfaces.Middleware) GetBroker(types.Worker) interfaces.Broker FetchBroker(func(types.Worker, interfaces.Broker)) AddBroker(brokerType types.Worker, b interfaces.Broker) // get primary sql database GetSQLDatabase() interfaces.SQLDatabase // get primary mongo database GetMongoDatabase() interfaces.MongoDatabase // get primary redis pool GetRedisPool() interfaces.RedisPool GetSQLDatabaseByKey(key string) interfaces.SQLDatabase GetMongoDatabaseByKey(key string) interfaces.MongoDatabase GetRedisPoolByKey(key string) 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) any AddExtended(key string, value any) interfaces.Closer }
Dependency base
type Option ¶
type Option func(*deps)
Option func type
func AddExtended ¶ added in v1.0.4
AddExtended option function for add extended
func AddMongoDatabase ¶ added in v1.18.0
func AddMongoDatabase(key string, db interfaces.MongoDatabase) Option
AddMongoDatabase option func, add new another mongo database instance
func AddRedisPool ¶ added in v1.18.0
func AddRedisPool(key string, db interfaces.RedisPool) Option
AddRedisPool option func, add new another redis pool instance
func AddSQLDatabase ¶ added in v1.18.0
func AddSQLDatabase(key string, db interfaces.SQLDatabase) Option
AddSQLDatabase option func, add new another sql database instance
func SetBrokers ¶ added in v1.7.0
func SetBrokers(brokers map[types.Worker]interfaces.Broker) Option
SetBrokers option func
func SetLocker ¶ added in v1.14.8
func SetLocker(lock interfaces.Locker) Option
SetLocker option func
func SetMongoDatabase ¶
func SetMongoDatabase(db interfaces.MongoDatabase) Option
SetMongoDatabase option func, set primary mongo database instance
func SetRedisPool ¶
func SetRedisPool(db interfaces.RedisPool) Option
SetRedisPool option func, set primary redis pool instance
func SetSQLDatabase ¶
func SetSQLDatabase(db interfaces.SQLDatabase) Option
SetSQLDatabase option func, set primary sql database instance
func SetValidator ¶
func SetValidator(validator interfaces.Validator) Option
SetValidator option func