config

package module
v0.0.0-...-bfffc22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 9 Imported by: 0

README

config

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ParserFunc

type ParserFunc func(data []byte) (map[string]any, error)

func (ParserFunc) Unmarshal

func (f ParserFunc) Unmarshal(data []byte) (map[string]any, error)

type ProviderFunc

type ProviderFunc func() ([]byte, error)

func (ProviderFunc) Read

func (f ProviderFunc) Read() ([]byte, error)

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

func NewRepository

func NewRepository() *Repository

func (*Repository) Any

func (r *Repository) Any(path string, defaultValue ...any) any

func (*Repository) AnyMap

func (r *Repository) AnyMap(path string, defaultValue ...map[string]any) map[string]any

func (*Repository) Anys

func (r *Repository) Anys(path string, defaultValue ...[]any) []any

func (*Repository) Bool

func (r *Repository) Bool(path string, defaultValue ...bool) bool

func (*Repository) BoolMap

func (r *Repository) BoolMap(path string, defaultValue ...map[string]bool) map[string]bool

func (*Repository) Bools

func (r *Repository) Bools(path string, defaultValue ...[]bool) []bool

func (*Repository) Bytes

func (r *Repository) Bytes(path string, defaultValue ...[]byte) []byte

func (*Repository) Cut

func (r *Repository) Cut(path string) repository.Repository

func (*Repository) Delete

func (r *Repository) Delete(path string) error

func (*Repository) Duration

func (r *Repository) Duration(path string, defaultValue ...time.Duration) time.Duration

func (*Repository) Float64

func (r *Repository) Float64(path string, defaultValue ...float64) float64

func (*Repository) Float64Map

func (r *Repository) Float64Map(path string, defaultValue ...map[string]float64) map[string]float64

func (*Repository) Float64s

func (r *Repository) Float64s(path string, defaultValue ...[]float64) []float64

func (*Repository) Get

func (r *Repository) Get(path string) (any, error)

func (*Repository) Has

func (r *Repository) Has(path string) bool

func (*Repository) Int

func (r *Repository) Int(path string, defaultValue ...int) int

func (*Repository) Int64

func (r *Repository) Int64(path string, defaultValue ...int64) int64

func (*Repository) Int64Map

func (r *Repository) Int64Map(path string, defaultValue ...map[string]int64) map[string]int64

func (*Repository) Int64s

func (r *Repository) Int64s(path string, defaultValue ...[]int64) []int64

func (*Repository) IntMap

func (r *Repository) IntMap(path string, defaultValue ...map[string]int) map[string]int

func (*Repository) Ints

func (r *Repository) Ints(path string, defaultValue ...[]int) []int

func (*Repository) Keys

func (r *Repository) Keys() []string

func (*Repository) Load

func (r *Repository) Load(provider repository.Provider, parser repository.Parser) error

func (*Repository) LoadAt

func (r *Repository) LoadAt(path string, provider repository.Provider, parser repository.Parser) error

func (*Repository) Merge

func (*Repository) MergeAt

func (r *Repository) MergeAt(path string, repo repository.Repository) (repository.Repository, error)

func (*Repository) Paths

func (r *Repository) Paths() []string

func (*Repository) Set

func (r *Repository) Set(path string, value any) error

func (*Repository) String

func (r *Repository) String(path string, defaultValue ...string) string

func (*Repository) StringMap

func (r *Repository) StringMap(path string, defaultValue ...map[string]string) map[string]string

func (*Repository) Strings

func (r *Repository) Strings(path string, defaultValue ...[]string) []string

func (*Repository) StringsMap

func (r *Repository) StringsMap(path string, defaultValue ...map[string][]string) map[string][]string

func (*Repository) Time

func (r *Repository) Time(path string, layout string, defaultValue ...time.Time) time.Time

func (*Repository) ToMap

func (r *Repository) ToMap() map[string]any

func (*Repository) Unmarshal

func (r *Repository) Unmarshal(path string, v any, conf *mapstructure.DecoderConfig) error

Directories

Path Synopsis
parser
json module
yaml module
provider
file module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL