GetBoolPtr returns a config value as a bool pointer.
(ns, key string)
| 378 | |
| 379 | // GetBoolPtr returns a config value as a bool pointer. |
| 380 | func (c *LiveConfig) GetBoolPtr(ns, key string) (*bool, error) { |
| 381 | if !c.IsSet(key) { |
| 382 | return nil, nil |
| 383 | } |
| 384 | val := viper.GetBool(nskey(ns, key)) |
| 385 | return &val, nil |
| 386 | } |
| 387 | |
| 388 | // GetInt returns a config value as an int. |
| 389 | func (c *LiveConfig) GetInt(ns, key string) (int, error) { |