added configgetmap

nats
Paulo Simão 2021-10-11 12:31:54 -03:00
parent bf8aaa2ca0
commit 3a7cad4f12
1 changed files with 12 additions and 0 deletions

View File

@ -66,6 +66,18 @@ func (c *Cli) ConfigGetAll() (ret []types.Config, err error) {
return
}
func (c *Cli) ConfigGetMap() (ret map[string]types.Config, err error) {
cfgs, err := c.ConfigGetAll()
if err != nil {
return
}
ret = make(map[string]types.Config)
for _, v := range cfgs {
ret[v.K] = v
}
return
}
func (c *Cli) CronReload() error {
return c.HttpCli().JsonGet("/ipc/cron/reload", nil)
}