Documentation ¶
Index ¶
- Constants
- func GetQueueName(typeName, name string) string
- func GetTLS(c *Tls) (*tls.Config, error)
- type Bootstrap
- type BotGroups
- type Config
- type CryptoOptions
- type FailedLimitOptions
- type JwtAuth
- type JwtOptions
- type MemoryOptions
- type MetricsOptions
- type NSQOptions
- type QueueGroups
- type RabbitmqOptions
- type RateLimitOptions
- type RedisOptions
- type RocketmqOptions
- type SettingOptions
- type System
- type SystemLogger
- type TgBot
- type Tls
- type TusOptions
- type UploadGroups
- type UploadOptions
Constants ¶
View Source
const ( DefaultGroupName = "default" // Default configuration group name. MemoryQueueName = "memory" RabbitmqQueueName = "rabbitmq" RocketQueueName = "rocketmq" )
Variables ¶
This section is empty.
Functions ¶
func GetQueueName ¶ added in v2.0.9
Types ¶
type Bootstrap ¶ added in v2.0.27
type Bootstrap struct {
// contains filtered or unexported fields
}
func NewBootstrap ¶ added in v2.0.29
func (*Bootstrap) After ¶ added in v2.0.28
func (b *Bootstrap) After(after ...boot.BootFunc) boot.IBootstrap
func (*Bootstrap) Before ¶ added in v2.0.28
func (b *Bootstrap) Before(before ...boot.BootFunc) boot.IBootstrap
func (*Bootstrap) Process ¶ added in v2.0.28
func (b *Bootstrap) Process(boots ...boot.Initialize) boot.IBootstrap
type BotGroups ¶ added in v2.0.28
type BotGroups struct {
Default *TgBot `json:"default,omitempty"`
}
type Config ¶
type Config struct { Database map[string]*gdb.ConfigNode `json:"database"` Redis map[string]*RedisOptions `json:"redis"` Server *ghttp.ServerConfig `json:"server"` Settings *SettingOptions `json:"settings"` Bot *BotGroups `json:"bot,omitempty"` Telegram *telegram.SendConf `json:"telegram,omitempty"` Erlang map[string]*service.NodeConfig `json:"erlang,omitempty"` }
type CryptoOptions ¶ added in v2.0.28
type CryptoOptions struct { Enable bool `json:"enable" yaml:"enable"` Algorithm string `json:"algorithm" yaml:"algorithm"` Rc4 security.Rc4CipherConfig `json:"rc4" yaml:"rc4"` Rsa security.RsaCiphersConfig `json:"rsa" yaml:"rsa"` Aes security.AesCipherConfig `json:"aes" yaml:"aes"` }
type FailedLimitOptions ¶ added in v2.0.28
type JwtAuth ¶ added in v2.0.28
type JwtAuth struct {
Jwt *JwtOptions `json:"jwt,omitempty"`
}
type JwtOptions ¶ added in v2.0.28
type JwtOptions struct { Secret string `yaml:"secret" json:"secret"` SigningKey string `yaml:"signingKey" json:"signing_key"` Timeout int64 `yaml:"timeout" json:"timeout"` MaxRefresh int64 `yaml:"maxRefresh" json:"max_refresh"` IdentityKey string `yaml:"identityKey" json:"identity_key"` BlacklistPrefix string `yaml:"blacklistPrefix" json:"blacklistPrefix"` }
type MemoryOptions ¶ added in v2.0.28
type MemoryOptions struct {
PoolSize uint `json:"poolSize,omitempty"`
}
type MetricsOptions ¶ added in v2.0.28
type NSQOptions ¶
type NSQOptions struct { DialTimeout time.Duration `opt:"dial_timeout" default:"1s"` // Deadlines for network reads and writes ReadTimeout time.Duration `opt:"read_timeout" min:"100ms" max:"5m" default:"60s"` WriteTimeout time.Duration `opt:"write_timeout" min:"100ms" max:"5m" default:"1s"` // Addresses is the local address to use when dialing an nsqd. Addresses []string `opt:"addresses"` ChannelPrefix string }
type QueueGroups ¶ added in v2.0.28
type QueueGroups struct { Memory *MemoryOptions `json:"memory,omitempty"` Rabbitmq map[string]*RabbitmqOptions `json:"rabbitmq,omitempty"` Rocketmq map[string]*RocketmqOptions `json:"rocketmq,omitempty"` Nsq *NSQOptions `json:"nsq"` }
type RabbitmqOptions ¶ added in v2.0.28
type RabbitmqOptions struct { DSN string `json:"dsn,omitempty"` Vhost string `json:"vhost,omitempty"` ChannelMax int64 `json:"channelMax,omitempty"` FrameSize int64 `json:"frameSize,omitempty"` Heartbeat int64 `json:"heartbeat,omitempty"` ReconnectInterval int `json:"reconnectInterval,omitempty"` MaxConnections int `json:"maxConnections,omitempty"` Cfg *rabbitmq.Config `json:"cfg" yaml:"cfg"` LogPath string `json:"logPath,omitempty"` LogFile string `json:"logFile,omitempty"` LogLevel string `json:"logLevel,omitempty"` LogStdout bool `json:"logStdout,omitempty"` }
type RateLimitOptions ¶ added in v2.0.44
type RateLimitOptions struct { Bucket int `json:"bucket" yaml:"bucket"` // refilled at rate “r” tokens per second. Limit int `json:"limit" yaml:"limit"` // It implements a “token bucket” of size “b” Burst int `json:"burst" yaml:"burst"` // exclude ip list Exclude []string `json:"exclude,omitempty" yaml:"exclude,omitempty"` }
type RedisOptions ¶ added in v2.0.33
type RedisOptions struct { gredis.Config // Base number of socket connections. // Default is 10 connections per every available CPU as reported by runtime.GOMAXPROCS. // If there are not enough connections in the pool, new connections will be allocated in excess of PoolSize; // you can limit it through MaxActiveConns PoolSize int ` yaml:"poolSize" json:"poolSize"` }
type RocketmqOptions ¶ added in v2.0.28
type SettingOptions ¶ added in v2.0.28
type SettingOptions struct { System *System `json:"system,omitempty"` Queue *QueueGroups `json:"queue,omitempty"` Uploads *UploadGroups `json:"uploads,omitempty"` Auth map[string]*JwtAuth `json:"auth,omitempty"` Websocket *ws.Config `json:"websocket,omitempty"` FailedLimit map[string]*FailedLimitOptions `json:"failedLimit,omitempty"` Metrics *MetricsOptions `json:"metrics,omitempty"` RateLimit *RateLimitOptions `json:"rateLimit,omitempty"` }
type System ¶ added in v2.0.28
type System struct { EnableCAPTCHA bool `json:"enableCaptcha,omitempty"` Logger *SystemLogger `json:"logger,omitempty"` DataPermission bool `json:"dataPermission,omitempty"` Crypto *CryptoOptions `json:"crypto,omitempty"` }
type SystemLogger ¶ added in v2.0.28
type SystemLogger struct {
EnabledDB bool `json:"enabledDb,omitempty"`
}
type TusOptions ¶ added in v2.0.28
type UploadGroups ¶ added in v2.0.28
type UploadGroups struct { Normal *UploadOptions `json:"normal,omitempty"` Tus map[string]*TusOptions `json:"tus,omitempty"` }
type UploadOptions ¶ added in v2.0.28
Click to show internal directories.
Click to hide internal directories.