Documentation
¶
Index ¶
- Constants
- Variables
- func AddConnection(ctx *gin.Context, name string, config *RedisConf_Client) error
- func Client(ctx *gin.Context, name ...string) *redis.Client
- type ConnectorInterface
- type GoRedisConnector
- type RedisComponent
- type RedisConf
- type RedisConf_Client
- type RedisConf_Client_Pool
- type RedisContainer
Constants ¶
View Source
const ( RedisConfigName = "RedisConf" DefaultClient = "default" )
Variables ¶
View Source
var Component = &RedisComponent{}
Functions ¶
func AddConnection ¶ added in v0.4.0
func AddConnection(ctx *gin.Context, name string, config *RedisConf_Client) error
Types ¶
type ConnectorInterface ¶ added in v0.4.0
type GoRedisConnector ¶ added in v0.4.0
type GoRedisConnector struct {
// contains filtered or unexported fields
}
func NewGoRedisConnector ¶ added in v0.4.0
func NewGoRedisConnector(connection string, config *RedisConf_Client) *GoRedisConnector
func (*GoRedisConnector) Connect ¶ added in v0.4.0
func (i *GoRedisConnector) Connect() error
func (*GoRedisConnector) GetClient ¶ added in v0.4.0
func (i *GoRedisConnector) GetClient() *redis.Client
func (*GoRedisConnector) GetConnection ¶ added in v0.4.0
func (i *GoRedisConnector) GetConnection() string
type RedisComponent ¶ added in v0.3.2
type RedisComponent struct{}
func (*RedisComponent) Inject ¶ added in v0.3.2
func (i *RedisComponent) Inject(instance any) bool
func (*RedisComponent) InjectConf ¶ added in v0.4.0
func (i *RedisComponent) InjectConf(config cComponents.ConfigInterface) bool
func (*RedisComponent) Listen ¶ added in v0.4.0
func (i *RedisComponent) Listen() []*cComponents.ConfigListener
func (*RedisComponent) Load ¶ added in v0.3.2
func (i *RedisComponent) Load()
type RedisConf ¶
type RedisConf struct {
Clients map[string]*RedisConf_Client `json:"clients"`
}
func (*RedisConf) ConfigName ¶
type RedisConf_Client ¶
type RedisConf_Client struct { Host string `json:"host"` Port int64 `json:"port"` Auth string `json:"auth"` DB int64 `json:"db"` Retries int64 `json:"retries"` DialTimeout int64 `json:"dial_timeout"` ReadTimeout int64 `json:"read_timeout"` WriteTimeout int64 `json:"write_timeout"` Pool *RedisConf_Client_Pool `json:"pool"` }
type RedisConf_Client_Pool ¶
type RedisContainer ¶
type RedisContainer struct {
// contains filtered or unexported fields
}
func (*RedisContainer) Get ¶
func (i *RedisContainer) Get(name string) any
func (*RedisContainer) Is ¶ added in v0.4.0
func (i *RedisContainer) Is(instance any) bool
func (*RedisContainer) Range ¶ added in v0.4.0
func (i *RedisContainer) Range(f func(instance any))
func (*RedisContainer) Remove ¶ added in v0.4.0
func (i *RedisContainer) Remove(name string) bool
func (*RedisContainer) Save ¶
func (i *RedisContainer) Save(instance any) bool
Click to show internal directories.
Click to hide internal directories.