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

package reader

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

Package reader parses change sets and provides config values

Index

Package Files

options.go preprocessor.go reader.go

func ReplaceEnvVars Uses

func ReplaceEnvVars(raw []byte) ([]byte, error)

type Option Uses

type Option func(o *Options)

func WithDisableReplaceEnvVars Uses

func WithDisableReplaceEnvVars() Option

WithDisableReplaceEnvVars disables the environment variable interpolation preprocessor

func WithEncoder Uses

func WithEncoder(e encoder.Encoder) Option

type Options Uses

type Options struct {
    Encoding              map[string]encoder.Encoder
    DisableReplaceEnvVars bool
}

func NewOptions Uses

func NewOptions(opts ...Option) Options

type Reader Uses

type Reader interface {
    Merge(...*source.ChangeSet) (*source.ChangeSet, error)
    Values(*source.ChangeSet) (Values, error)
    String() string
}

Reader is an interface for merging changesets

type Value Uses

type Value interface {
    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

type Values Uses

type Values interface {
    Bytes() []byte
    Get(path ...string) Value
    Set(val interface{}, path ...string)
    Del(path ...string)
    Map() map[string]interface{}
    Scan(v interface{}) error
}

Values is returned by the reader

Directories

PathSynopsis
json

Package reader imports 10 packages (graph) and is imported by 13 packages. Updated 2020-07-31. Refresh now. Tools for package owners.