From 19d88fc879ba403347726138eb532fb85d38168e Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Sun, 23 Sep 2018 14:52:55 +0300 Subject: default configs --- service/rpc/config.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'service/rpc') diff --git a/service/rpc/config.go b/service/rpc/config.go index 93fce7ca..653da6ea 100644 --- a/service/rpc/config.go +++ b/service/rpc/config.go @@ -26,6 +26,14 @@ func (c *Config) Hydrate(cfg service.Config) error { return c.Valid() } +// InitDefaults allows to init blank config with pre-defined set of default values. +func (c *Config) InitDefaults() error { + c.Enable = true + c.Listen = "tcp://127.0.0.1:6001" + + return nil +} + // Valid returns nil if config is valid. func (c *Config) Valid() error { if dsn := strings.Split(c.Listen, "://"); len(dsn) != 2 { -- cgit v1.2.3