gonews/configuration/config.go

33 lines
1.0 KiB
Go
Raw Normal View History

2019-09-02 22:24:34 +05:00
package configuration
// Represents configuration file structure.
type config struct {
2019-09-09 21:52:32 +05:00
// Database represents database configuration.
Database Database `yaml:"database"`
2019-09-02 22:24:34 +05:00
// Network represents network stack configuration.
Network []Network `yaml:"network"`
}
2019-09-09 21:52:32 +05:00
type Database struct {
// DSN is a connection string in form "proto://user:password@host:port/database".
DSN string `yaml:"dsn"`
// Params is a DSN params that will be added to DSN after
// connection string itself.
Params string `yaml:"params"`
// Timeout is a timeout for connection watcher. Every this
// count of seconds connection watcher will check if database
// connection is alive.
Timeout int64 `yaml:"timeout"`
}
2019-09-02 22:24:34 +05:00
type Network struct {
// Address represents address to bing in form of "ip:port".
Address string `yaml:"address"`
// Limit sets maximum simultaneous connections that can be
// processed by worker.
Limit int `yaml:"limit"`
// Type sets connection type. See networker for available
// types.
Type string `yaml:"type"`
}