Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Configure ¶
type Configure struct {
types.AutoConfigure `prefix:"application.cache"`
Instance string `yaml:"instance"`
}
type FactoryBean ¶ added in v1.4.4
type FactoryBean struct {
types.FactoryBean `singleton:"true"`
Cache *Configure
}
func NewStarter ¶ added in v1.3.6
func NewStarter() *FactoryBean
func (*FactoryBean) GetBeanType ¶ added in v1.4.4
func (r *FactoryBean) GetBeanType() reflect.Type
type ICache ¶
type ICache interface {
bean.Bean
Conn() (ICache, error)
Set(key string, value interface{}) (string, error)
Del(key string) (int64, error)
Get(key string) (string, error)
}
func GetCacheImplByName ¶
type RedisCache ¶ added in v1.2.9
type RedisCache struct {
types.Component
Log log.Logger `wire:""`
Conf *RedisConfigure
// contains filtered or unexported fields
}
func (*RedisCache) Conn ¶ added in v1.2.9
func (r *RedisCache) Conn() (cache ICache, err error)
type RedisConfigure ¶ added in v1.2.9
type RedisConfigure struct {
types.AutoConfigure `prefix:"application.redis"`
Network string `yaml:"network"`
Host string `yaml:"host"`
Username string `yaml:"username"`
Password string `yaml:"password"`
DB int `yaml:"db"`
MaxRetries int `yaml:"max_retries"`
MinRetryBackoff time.Duration `yaml:"min_retry_backoff"`
MaxRetryBackoff time.Duration `yaml:"max_retry_backoff"`
DialTimeout time.Duration `yaml:"dial_timeout"`
ReadTimeout time.Duration `yaml:"read_timeout"`
WriteTimeout time.Duration `yaml:"write_timeout"`
PoolSize int `yaml:"pool_size"`
MinIdleConns int `yaml:"min_idle_conns"`
MaxConnAge time.Duration `yaml:"max_conn_age"`
PoolTimeout time.Duration `yaml:"pool_timeout"`
IdleTimeout time.Duration `yaml:"idle_timeout"`
IdleCheckFrequency time.Duration `yaml:"idle_check_frequency"`
}
func (*RedisConfigure) Adapter ¶ added in v1.2.9
func (r *RedisConfigure) Adapter() *redis.Options
Click to show internal directories.
Click to hide internal directories.