Documentation ¶
Overview ¶
Package config is an interface for dynamic configuration.
Index ¶
- func Delete(path string, options ...Option) error
- func Set(path string, val interface{}, options ...Option) error
- type Config
- type JSONValue
- func (j *JSONValue) Bool(def bool) bool
- func (j *JSONValue) Bytes() []byte
- func (j *JSONValue) Duration(def time.Duration) time.Duration
- func (j *JSONValue) Exists() bool
- func (j *JSONValue) Float64(def float64) float64
- func (j *JSONValue) Int(def int) int
- func (j *JSONValue) Scan(v interface{}) error
- func (j *JSONValue) String(def string) string
- func (j *JSONValue) StringMap(def map[string]string) map[string]string
- func (j *JSONValue) StringSlice(def []string) []string
- type JSONValues
- func (j *JSONValues) Bytes() []byte
- func (j *JSONValues) Delete(path string, options ...Option)
- func (j *JSONValues) Get(path string, options ...Option) Value
- func (j *JSONValues) Map() map[string]interface{}
- func (j *JSONValues) Scan(v interface{}) error
- func (j *JSONValues) Set(path string, val interface{}, options ...Option)
- func (j *JSONValues) String() string
- type Option
- type Options
- type Secrets
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config interface { Get(path string, options ...Option) (Value, error) Set(path string, val interface{}, options ...Option) error Delete(path string, options ...Option) error }
Config is an interface abstraction for dynamic configuration
var DefaultConfig Config
DefaultConfig implementation
type JSONValues ¶
type JSONValues struct {
// contains filtered or unexported fields
}
func NewJSONValues ¶
func NewJSONValues(data []byte) *JSONValues
func (*JSONValues) Bytes ¶
func (j *JSONValues) Bytes() []byte
func (*JSONValues) Delete ¶
func (j *JSONValues) Delete(path string, options ...Option)
func (*JSONValues) Map ¶
func (j *JSONValues) Map() map[string]interface{}
func (*JSONValues) Scan ¶
func (j *JSONValues) Scan(v interface{}) error
func (*JSONValues) Set ¶
func (j *JSONValues) Set(path string, val interface{}, options ...Option)
func (*JSONValues) String ¶
func (j *JSONValues) String() string
type Value ¶
type Value interface { Exists() bool Bool(def bool) bool Int(def int) int String(def string) string Float64(def float64) float64 Duration(def time.Duration) time.Duration StringSlice(def []string) []string StringMap(def map[string]string) map[string]string Scan(val interface{}) error Bytes() []byte }
Value represents a value of any type
Click to show internal directories.
Click to hide internal directories.