Documentation
¶
Index ¶
- Variables
- func SetManual(man map[string]string) map[string]string
- type ConsumerCallbacIsDone
- type ConsumerCallback
- type Database
- type Embedded
- type EmbeddedOptions
- type Encoder
- type Encoding
- type Messages
- type Provider
- type RabbitMQ
- type RabbitMQOptions
- type RabbitMQProviderConfig
- type SQL
- type SQLConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigManual = map[string]string{
"config:mysql:enable": `enable mysql database`,
"config:mysql:host": `mysql server address, must be valid rules hostname_rfc1123
ex: localhost, 127.0.0.1, service.domain, 10.10.10.10, etc.`,
"config:mysql:port": `mysql server port number`,
"config:mysql:username": `mysql server username`,
"config:mysql:password": `mysql server password`,
"config:mysql:database": `mysql database name`,
"config:mysql:options": `this option will be added after username:password@protocol(address)/dbname?`,
"config:mysql:connection": `if this value not empty, another mysql parameter will be ignored.
use this, if you have a custom protocol connection.
like username:password@unix(/tmp/mysql.sock)/dbname.
see more : https://github.com/go-sql-driver/mysql`,
"config:rabbitmq:enable": `enable rabbitmq database message brokers`,
"config:rabbitmq:host": `rabbitmq server address, must be valid rules hostname_rfc1123
ex: localhost, 127.0.0.1, service.domain, 10.10.10.10, etc.`,
"config:rabbitmq:port": `rabbitmq server port number`,
"config:rabbitmq:username": `rabbitmq server username`,
"config:rabbitmq:password": `rabbitmq server password`,
"config:rabbitmq:reconnectDuration": `rabbitmq reconnect duration (in second).`,
"config:rabbitmq:dedicatedConnection": `dedicated connection for each consumer, more reliable but more cost.`,
}
Functions ¶
Types ¶
type ConsumerCallbacIsDone ¶
type ConsumerCallbacIsDone struct {
Done context.CancelFunc
EndRequest func()
}
type ConsumerCallback ¶
type ConsumerCallback func(Messages, ConsumerCallbacIsDone)
type Embedded ¶
type Embedded interface {
DB() *nutsdb.DB
Set(bucket string, key string, value interface{}, encoding Encoding) (err error)
Get(bucket string, key string, value interface{}, encoding Encoding) (err error)
Delete(bucket string, key string) (err error)
GetAllKeys(bucket string) (keys []string, err error)
}
type EmbeddedOptions ¶
type EmbeddedOptions struct {
Directory string
}
type Messages ¶
type RabbitMQ ¶
type RabbitMQ interface {
Consumer(RabbitMQOptions, ConsumerCallback)
Producer(RabbitMQOptions)
Push(ctx context.Context,
id, exchange,
key string,
body interface{},
cb ConsumerCallback) error
}
type RabbitMQOptions ¶
type RabbitMQProviderConfig ¶
type RabbitMQProviderConfig struct {
Enable bool `yaml:"enable" default:"false" desc:"config:rabbitmq:enable"`
Host string `yaml:"host" default:"127.0.0.1" desc:"config:rabbitmq:host"`
Port int `yaml:"port" default:"5672" desc:"config:rabbitmq:port"`
Username string `yaml:"username" default:"guest" desc:"config:rabbitmq:username"`
Password string `yaml:"password" default:"guest" desc:"config:rabbitmq:password"`
ReconnectDuration int `yaml:"reconnectDuration" default:"5" desc:"config:rabbitmq:reconnectDuration"`
DedicatedConnection bool `yaml:"dedicatedConnection" default:"false" desc:"config:rabbitmq:dedicatedConnection"`
}
type SQLConfig ¶
type SQLConfig struct {
Enable bool `yaml:"enable" default:"false" desc:"config:mysql:enable"`
Host string `yaml:"host" default:"127.0.0.1" desc:"config:mysql:host"`
Port int `yaml:"port" default:"3306" desc:"config:mysql:port"`
Username string `yaml:"username" default:"root" desc:"config:mysql:username"`
Password string `yaml:"password" default:"root" desc:"config:mysql:password"`
Database string `yaml:"database" default:"mydb" desc:"config:mysql:database"`
Options string `yaml:"options" default:"" desc:"config:mysql:options"`
Connection string `yaml:"connection" default:"" desc:"config:mysql:connection"`
}
Click to show internal directories.
Click to hide internal directories.