gonewsctl stub, groups create/delete queries, http server for API.

This commit is contained in:
2019-10-22 05:47:59 +05:00
parent bc7b9925a1
commit 2e10081b99
10 changed files with 306 additions and 1 deletions

View File

@@ -4,6 +4,8 @@ package configuration
type config struct {
// Database represents database configuration.
Database Database `yaml:"database"`
// HTTP represents HTTP server configuration.
HTTP HTTP `yaml:"http"`
// Network represents network stack configuration.
Network []Network `yaml:"network"`
}
@@ -20,6 +22,16 @@ type Database struct {
Timeout int64 `yaml:"timeout"`
}
type HTTP struct {
// Listen is an address in form "ip:port" on which HTTP server
// will listen to requests.
Listen string `yaml:"listen"`
// WaitForSeconds is a timeout for waiting for HTTP server to be
// ready. If timeout will be passed and HTTP server will not be ready
// to process requests - we will exit.
WaitForSeconds int `yaml:"wait_for_seconds"`
}
type Network struct {
// Address represents address to bing in form of "ip:port".
Address string `yaml:"address"`