config

package
v1.77.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(structPtr Config)

func Load added in v1.71.0

func Load(dst Config, filename string) error

func Marshal added in v1.71.0

func Marshal(src Config, w io.Writer) error

func Save added in v1.71.0

func Save(src Config, filename string) error

func Unmarshal added in v1.71.0

func Unmarshal(dst Config, r io.Reader) error

Types

type AES added in v1.73.0

type AES struct {
	Key string // need len 16 or 32
	Val string
}

func NewAES added in v1.73.0

func NewAES(val, key string) *AES

func (*AES) GetString added in v1.73.0

func (f *AES) GetString(converted bool) string

func (*AES) SetString added in v1.73.0

func (f *AES) SetString(value string, converted bool)

func (*AES) String added in v1.73.0

func (f *AES) String() string

type Base64 added in v1.73.0

type Base64 string

func (Base64) GetString added in v1.73.0

func (s Base64) GetString(converted bool) string

func (*Base64) SetString added in v1.73.0

func (s *Base64) SetString(value string, converted bool)

func (Base64) String added in v1.73.0

func (s Base64) String() string

type Config added in v1.71.0

type Config interface {
	GetValue() *Value
	SetValue(path, value string, converted, allowEmpty bool) (ok bool)
	SetDefaults()
	ScanValues(converted bool, iter valueField) error
}

type Duration added in v1.72.37

type Duration struct{ time.Duration }

Duration pretty type based on time.Duration

func NewDuration added in v1.72.37

func NewDuration(d time.Duration) Duration

func ParseDuration added in v1.72.37

func ParseDuration(s string) (d Duration, ok bool)

ParseDuration string "- 0d 0h 0m 0s 0ms 0us 0ns"

func (Duration) GetString added in v1.73.0

func (dt Duration) GetString(converted bool) string

func (Duration) Seconds added in v1.72.38

func (dt Duration) Seconds() int

func (*Duration) SetString added in v1.73.0

func (dt *Duration) SetString(value string, converted bool)

SetString "- 0d 0h 0m 0s 0ms 0us 0ns"

func (Duration) String added in v1.72.37

func (dt Duration) String() string

String returns (without spaces) "- 0d 0h 0m 0s 0ms 0us 0ns"

type Field added in v1.73.0

type Field interface {
	GetString(converted bool) string
	SetString(value string, converted bool)
}

type Value

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

func (*Value) GetValue

func (val *Value) GetValue() *Value

func (*Value) ScanValues

func (val *Value) ScanValues(converted bool, iter valueField) error

func (*Value) SetDefaults added in v1.71.0

func (val *Value) SetDefaults()

func (*Value) SetValue

func (val *Value) SetValue(path, value string, converted, allowEmpty bool) (ok bool)

Jump to

Keyboard shortcuts

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