added global config

nats
Paulo Simão 2021-10-11 19:08:32 -03:00
parent d12b549846
commit a6a48c459b
1 changed files with 4 additions and 2 deletions

View File

@ -73,13 +73,15 @@ func (c *Cli) ConfigGet(k string) (ret string, err error) {
err = c.HttpCli().JsonGet("/api/v1/config/byrepo/"+util.Repo()+"/"+k, &ret) err = c.HttpCli().JsonGet("/api/v1/config/byrepo/"+util.Repo()+"/"+k, &ret)
return return
} }
func (c *Cli) ConfigGetGlobal(k string) (ret string, err error) {
err = c.HttpCli().JsonGet("/api/v1/config/global/"+k, &ret)
return
}
func (c *Cli) ConfigGetAll() (ret []types.Config, err error) { func (c *Cli) ConfigGetAll() (ret []types.Config, err error) {
ret = make([]types.Config, 0) ret = make([]types.Config, 0)
err = c.HttpCli().JsonGet("/api/v1/config/byrepo/"+util.Repo(), &ret) err = c.HttpCli().JsonGet("/api/v1/config/byrepo/"+util.Repo(), &ret)
return return
} }
func (c *Cli) ConfigGetMap() (ret map[string]types.Config, err error) { func (c *Cli) ConfigGetMap() (ret map[string]types.Config, err error) {
cfgs, err := c.ConfigGetAll() cfgs, err := c.ConfigGetAll()
if err != nil { if err != nil {