Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAppAlreadyExists = errors.New("app already exists")
View Source
var ErrNamespaceAlreadyExists = errors.New("namespace already exists")
View Source
var ErrNotFound = errors.New("404 not found")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Etcd EtcdConfig
Mysql MysqlConfig
}
type EtcdConfig ¶
type EtcdConfig struct {
// Endpoints is a list of URLs.
Endpoints []string `json:"endpoints"`
// AutoSyncInterval is the interval to update endpoints with its latest members.
// 0 disables auto-sync. By default auto-sync is disabled.
AutoSyncInterval time.Duration `json:"auto-sync-interval"`
// DialTimeout is the timeout for failing to establish a connection.
DialTimeout time.Duration `json:"dial-timeout"`
// DialKeepAliveTime is the time after which client pings the entry to see if
// transport is alive.
DialKeepAliveTime time.Duration `json:"dial-keep-alive-time"`
// DialKeepAliveTimeout is the time that the client waits for a response for the
// keep-alive probe. If the response is not received in this time, the connection is closed.
DialKeepAliveTimeout time.Duration `json:"dial-keep-alive-timeout"`
// MaxCallSendMsgSize is the client-side request send limit in bytes.
// If 0, it defaults to 2.0 MiB (2 * 1024 * 1024).
// Make sure that "MaxCallSendMsgSize" < entry-side default send/recv limit.
// ("--max-request-bytes" flag to etcd or "embed.EtcdConfig.MaxRequestBytes").
MaxCallSendMsgSize int
// MaxCallRecvMsgSize is the client-side response receive limit.
// If 0, it defaults to "math.MaxInt32", because range response can
// easily exceed request send limits.
// Make sure that "MaxCallRecvMsgSize" >= entry-side default send/recv limit.
// ("--max-request-bytes" flag to etcd or "embed.EtcdConfig.MaxRequestBytes").
MaxCallRecvMsgSize int
// TLS holds the client secure credentials, if any.
TLS *tls.Config
// Username is a user name for authentication.
Username string `json:"username"`
// Password is a password for authentication.
Password string `json:"password"`
}
type MysqlConfig ¶
type MysqlConfig struct {
DSN string // data source name.
MaxOpenConns int // pool
MaxIdleConns int // pool
ConnMaxLifetime time.Duration //
ConnMaxIdleTime time.Duration //
}
dsn = "{user}:{password}@tcp(127.0.0.1:3306)/{database}?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8"
maxOpenConns = 20
maxIdleConns = 10
connMaxLifetime = "60s"
connMaxIdleTime ="4h"
EtcdConfig mysql conf.
Click to show internal directories.
Click to hide internal directories.