Documentation ¶
Index ¶
Constants ¶
View Source
const ( WorkerInfoServer uwe.WorkerName = "info-server" WorkerAPIServer uwe.WorkerName = "api-server" WorkerDBKeeper uwe.WorkerName = "db-keeper" WorkerFooBar uwe.WorkerName = "foobar" )
View Source
const ServiceName = "service-scaffold"
TODO: change me
Variables ¶
View Source
var AvailableWorkers = map[uwe.WorkerName]struct{}{ WorkerInfoServer: {}, WorkerDBKeeper: {}, WorkerAPIServer: {}, WorkerFooBar: {}, }
Functions ¶
Types ¶
type Cfg ¶
type Cfg struct { Api api.Config `json:"api" yaml:"api"` DB DBCfg `json:"db" yaml:"db"` // DB is a database connection string. CouchDB string `json:"couchdb" yaml:"couchdb"` // CouchDB is a couchdb url connection string. NATS natsx.Config `json:"nats" yaml:"nats"` Log log.Config `json:"log" yaml:"log"` DevMode bool `json:"dev_mode" yaml:"dev_mode"` ServicesInitTimeout int `json:"servicesInitTimeout" yaml:"services_init_timeout"` // Workers is a list of workers // that must be started, start all if empty. Workers []uwe.WorkerName `yaml:"workers"` }
Cfg main structure of the app configuration.
func (Cfg) FillDefaultWorkers ¶
func (cfg Cfg) FillDefaultWorkers()
type DBCfg ¶
type DBCfg struct { ConnURL string `json:"conn_url" yaml:"conn_url"` //The database connection string. InitTimeout int `json:"dbInitTimeout" yaml:"init_timeout"` // AutoMigrate if `true` execute db migrate up on start. AutoMigrate bool `json:"auto_migrate" yaml:"auto_migrate"` WaitForDB bool `json:"wait_for_db" yaml:"wait_for_db"` }
type WorkerExistRule ¶
type WorkerExistRule struct { AvailableWorkers map[uwe.WorkerName]struct{} // contains filtered or unexported fields }
func (*WorkerExistRule) Error ¶
func (r *WorkerExistRule) Error(message string) *WorkerExistRule
Error sets the error message for the rule.
func (*WorkerExistRule) Validate ¶
func (r *WorkerExistRule) Validate(value interface{}) error
Validate checks that service exist on the system
Click to show internal directories.
Click to hide internal directories.