Documentation
¶
Index ¶
- Variables
- func GetRedisClient() *redis.Client
- func SetRedisClient(c *redis.Client)
- func Setup(f func(opts ...source.Option) source.Source, options ...source.Option)
- func Stop()
- func Watch()
- type Application
- type Cache
- type Config
- type DBResolverConfig
- type Database
- type Gen
- type Jwt
- type Locker
- type Logger
- type Queue
- type QueueMemory
- type QueueRedis
- type RedisConnectOptions
- type Settings
- type Ssl
- type Tls
Constants ¶
This section is empty.
Variables ¶
View Source
var ApplicationConfig = new(Application)
View Source
var CacheConfig = new(Cache)
CacheConfig cache配置
View Source
var (
ExtendConfig interface{}
)
View Source
var GenConfig = new(Gen)
View Source
var JwtConfig = new(Jwt)
View Source
var LockerConfig = new(Locker)
View Source
var LoggerConfig = new(Logger)
View Source
var QueueConfig = new(Queue)
View Source
var SslConfig = new(Ssl)
Functions ¶
func SetRedisClient ¶ added in v1.3.6
func SetRedisClient(c *redis.Client)
SetRedisClient 设置redis客户端
Types ¶
type Application ¶
type Cache ¶ added in v1.3.6
type Cache struct {
Redis *RedisConnectOptions
Memory interface{}
}
type Config ¶
type Config struct {
Application *Application `yaml:"application"`
Ssl *Ssl `yaml:"ssl"`
Logger *Logger `yaml:"logger"`
Jwt *Jwt `yaml:"jwt"`
Database *Database `yaml:"database"`
Databases *map[string]*Database `yaml:"databases"`
Gen *Gen `yaml:"gen"`
Cache *Cache `yaml:"cache"`
Queue *Queue `yaml:"queue"`
Locker *Locker `yaml:"locker"`
Extend interface{} `yaml:"extend"`
}
Config 配置集合
type DBResolverConfig ¶
type Locker ¶ added in v1.3.6
type Locker struct {
Redis *RedisConnectOptions
}
type Queue ¶ added in v1.3.6
type Queue struct {
Redis *QueueRedis
Memory *QueueMemory
}
type QueueMemory ¶ added in v1.3.6
type QueueMemory struct {
PoolSize uint
}
type QueueRedis ¶ added in v1.3.6
type QueueRedis struct {
RedisConnectOptions
Producer *redisqueue.ProducerOptions
Consumer *redisqueue.ConsumerOptions
}
type RedisConnectOptions ¶ added in v1.3.6
type RedisConnectOptions struct {
Network string `yaml:"network" json:"network"`
Addr string `yaml:"addr" json:"addr"`
Username string `yaml:"username" json:"username"`
Password string `yaml:"password" json:"password"`
DB int `yaml:"db" json:"db"`
PoolSize int `yaml:"pool_size" json:"pool_size"`
Tls *Tls `yaml:"tls" json:"tls"`
MaxRetries int `yaml:"max_retries" json:"max_retries"`
}
func (RedisConnectOptions) GetRedisOptions ¶ added in v1.3.6
func (e RedisConnectOptions) GetRedisOptions() (*redis.Options, error)
Click to show internal directories.
Click to hide internal directories.