go-micro: github.com/micro/go-micro/config Index | Files | Directories

package config

import "github.com/micro/go-micro/config"

Package config is an interface for dynamic configuration.


Package Files

config.go value.go

type Config Uses

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

type JSONValue Uses

type JSONValue struct {

func NewJSONValue Uses

func NewJSONValue(data []byte) *JSONValue

func (*JSONValue) Bool Uses

func (j *JSONValue) Bool(def bool) bool

func (*JSONValue) Bytes Uses

func (j *JSONValue) Bytes() []byte

func (*JSONValue) Duration Uses

func (j *JSONValue) Duration(def time.Duration) time.Duration

func (*JSONValue) Exists Uses

func (j *JSONValue) Exists() bool

func (*JSONValue) Float64 Uses

func (j *JSONValue) Float64(def float64) float64

func (*JSONValue) Int Uses

func (j *JSONValue) Int(def int) int

func (*JSONValue) Scan Uses

func (j *JSONValue) Scan(v interface{}) error

func (*JSONValue) String Uses

func (j *JSONValue) String(def string) string

func (*JSONValue) StringMap Uses

func (j *JSONValue) StringMap(def map[string]string) map[string]string

func (*JSONValue) StringSlice Uses

func (j *JSONValue) StringSlice(def []string) []string

type JSONValues Uses

type JSONValues struct {
    // contains filtered or unexported fields

func NewJSONValues Uses

func NewJSONValues(data []byte) *JSONValues

func (*JSONValues) Bytes Uses

func (j *JSONValues) Bytes() []byte

func (*JSONValues) Delete Uses

func (j *JSONValues) Delete(path string, options ...Option)

func (*JSONValues) Get Uses

func (j *JSONValues) Get(path string, options ...Option) Value

func (*JSONValues) Map Uses

func (j *JSONValues) Map() map[string]interface{}

func (*JSONValues) Scan Uses

func (j *JSONValues) Scan(v interface{}) error

func (*JSONValues) Set Uses

func (j *JSONValues) Set(path string, val interface{}, options ...Option)

func (*JSONValues) String Uses

func (j *JSONValues) String() string

type Option Uses

type Option func(o *Options)

func Secret Uses

func Secret(b bool) Option

type Options Uses

type Options struct {
    Secret bool

type Secrets Uses

type Secrets interface {

type Value Uses

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


envPackage env provides config from environment variables
source/memoryPackage memory is a memory source

Package config imports 6 packages (graph) and is imported by 13 packages. Updated 2020-10-01. Refresh now. Tools for package owners.