config

package
v0.2.19 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRequired               = fmt.Errorf("required")
	ErrMutualReference        = fmt.Errorf("mutual reference or invalid value")
	ErrOverlayHierarchicalKey = fmt.Errorf("overlay hierarchical key")
)

Functions

func FuzzyDecode

func FuzzyDecode(to interface{}, val string) bool

func GetValueHierarchicalStruct added in v0.2.15

func GetValueHierarchicalStruct(m interface{}, key string) (reflect.Value, error)

func SetValueHierarchicalMap

func SetValueHierarchicalMap(m map[string]interface{}, key string, val interface{}) error

func SetValueHierarchicalStruct

func SetValueHierarchicalStruct(m interface{}, key string, val string) error

Types

type Binder

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

func NewBinder

func NewBinder(viper *viper.Viper) *Binder

func (*Binder) Bind

func (b *Binder) Bind(iface interface{}) error

type Cache

type Cache struct {
	Subscription CacheSubscription `mapstructure:"subscription"`
}

type CacheSubscription

type CacheSubscription struct {
	LastNode string `mapstructure:"last_node"`
}

type Params

type Params struct {
	Node         string       `mapstructure:"node"`
	Subscription Subscription `mapstructure:"subscription"`

	Cache Cache `mapstructure:"cache"`

	NoUDP         bool `mapstructure:"no_udp"`
	ProxyPrivate  bool `mapstructure:"proxy_private"`
	AllowInsecure bool `mapstructure:"allow_insecure"`

	TestNode bool   `mapstructure:"test_node_before_use" default:"true"`
	TestURL  string `mapstructure:"test_url" default:"https://connectivitycheck.gstatic.com/generate_204"`
}
var ParamsObj Params

type Subscription

type Subscription struct {
	Link          string `mapstructure:"link"`
	Select        string `mapstructure:"select" default:"first"`
	CacheLastNode bool   `mapstructure:"cache_last_node" default:"true"`
}

Jump to

Keyboard shortcuts

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