configs

package
v0.0.0-...-78a6345 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Uploaders = map[string]func() fs.Uploader{
		"qiniu": func() fs.Uploader {
			return new(qiniu.Uploader)
		},
	}

	MailSenders = map[string]func() mail.Sender{
		"sendcloud": func() mail.Sender { return new(sendcloud.Email) },
	}

	SmsSenders = map[string]func() sms.Sender{
		"smsbao": func() sms.Sender { return new(smsbao.Sms) },
	}
)

Functions

This section is empty.

Types

type DbConfig

type DbConfig struct {
	Driver string `json:"driver"`
	Dsn    string `json:"dsn"`
}

type EmailConfig

type EmailConfig struct {
	Enable  bool        `yaml:"enable" json:"enable"`
	Driver  string      `yaml:"driver" json:"driver"`
	Content interface{} `yaml:"content" json:"content"`
}

type HttpConfig

type HttpConfig struct {
	Addr           string `json:"addr" yaml:"addr"`
	Key            string `json:"key" yaml:"key"`
	Cert           string `json:"cert" yaml:"cert"`
	EnableRegister bool   `json:"enable_register" yaml:"enable_register"`
	EnableVerify   bool   `json:"enable_verify" yaml:"enable_verify"`
	JwtKey         string `json:"jwt_key" yaml:"jwt_key"`
}

type PushServer

type PushServer struct {
	Addr []string `json:"addr" yaml:"addr"`
}

type RedisConfig

type RedisConfig struct {
	// 如果是哨兵,哨兵需要配置这个名字.
	MasterName string `json:"master_name" yaml:"master_name"`
	// 如果是集群配置,则配置多个地址
	// 单机配置为1个地址.
	Addrs    []string `json:"addrs" yaml:"addrs"`
	DB       int      `json:"db"`
	Password string   `json:"password" yaml:"password"`
	Timeout  int      `json:"timeout" yaml:"timeout"` // uint: 秒
}

UniversalOptions information is required by UniversalClient to establish connections.

type SmsConfig

type SmsConfig struct {
	Enable  bool        `yaml:"enable" json:"enable"`
	Driver  string      `yaml:"driver" json:"driver"`
	Content interface{} `yaml:"content" json:"content"`
}

type TCPConfig

type TCPConfig struct {
	ReadChannelSize  int    `json:"channel_size" yaml:"read_channel_size"`        // 读缓冲区大小
	WriteChannelSize int    `json:"write_channel_size" yaml:"write_channel_size"` // 写缓冲区大小
	Addr             string `json:"addr" yaml:"addr"`                             // 监听地址
	MaxConns         uint64 `json:"max_conns" yaml:"max_conns"`                   // 最大连接数量.
	Timeout          int    `json:"timeout" yaml:"timeout"`                       // 超时控制.
}

type UploadConfig

type UploadConfig struct {
	Driver  string      `json:"driver"`
	Content interface{} `yaml:"content" json:"content"`
}

type WebConfig

type WebConfig struct {
	HttpConfig   HttpConfig   `yaml:"http_config" json:"http_config"`
	RedisConfig  RedisConfig  `yaml:"redis_config" json:"redis_config"`
	EmailConfig  EmailConfig  `yaml:"email_config" json:"email_config"`
	SmsConfig    SmsConfig    `yaml:"sms_config" json:"sms_config"`
	DbConfig     DbConfig     `yaml:"db_config" json:"db_config"`
	PushServer   PushServer   `yaml:"push_server" json:"push_server"`
	UploadConfig UploadConfig `yaml:"upload_config" json:"upload_config"`
}

func ParseWebConfig

func ParseWebConfig(data []byte) (WebConfig, error)

type WebsocketConfig

type WebsocketConfig struct {
	ReadChannelSize  int    `json:"channel_size" yaml:"read_channel_size"`        // 读缓冲区大小
	WriteChannelSize int    `json:"write_channel_size" yaml:"write_channel_size"` // 写缓冲区大小
	Addr             string `json:"addr" yaml:"addr"`                             // 监听地址
	MaxConns         int    `json:"max_conns" yaml:"max_conns"`                   // 最大连接数量.
	Timeout          int    `json:"timeout" yaml:"timeout"`                       // 超时控制.
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL