config

package module
v4.8.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 9 Imported by: 4

README

Documentation

Index

Constants

View Source
const (
	PluginName string = "config"
)

Variables

This section is empty.

Functions

func ExpandVal added in v4.3.0

func ExpandVal(s string, mapping func(string) string) string

ExpandVal replaces ${var} or $var in the string based on the mapping function. For example, os.ExpandEnv(s) is equivalent to os.Expand(s, os.Getenv).

Types

type Plugin

type Plugin struct {
	Path      string
	Prefix    string
	Type      string
	ReadInCfg []byte
	// user defined Flags in the form of <option>.<key> = <value>
	// which overwrites initial a config key
	Flags []string
	// ExperimentalFeatures enables experimental features
	ExperimentalFeatures bool
	// Timeout ...
	Timeout time.Duration
	// RRVersion passed from the Endure.
	Version string
	// contains filtered or unexported fields
}

func (*Plugin) Experimental added in v4.5.0

func (p *Plugin) Experimental() bool

Experimental returns true if experimental features are enabled

func (*Plugin) Get

func (p *Plugin) Get(name string) any

Get raw config in the form of a config section.

func (*Plugin) GracefulTimeout

func (p *Plugin) GracefulTimeout() time.Duration

func (*Plugin) Has

func (p *Plugin) Has(name string) bool

Has checks if a config section exists.

func (*Plugin) Init

func (p *Plugin) Init() error

Init config provider.

func (*Plugin) Name

func (p *Plugin) Name() string

Name returns user-friendly plugin name

func (*Plugin) Overwrite

func (p *Plugin) Overwrite(values map[string]any) error

Overwrite overwriting existing config with provided values

func (*Plugin) RRVersion

func (p *Plugin) RRVersion() string

RRVersion returns current RR version

func (*Plugin) Unmarshal

func (p *Plugin) Unmarshal(out any) error

func (*Plugin) UnmarshalKey

func (p *Plugin) UnmarshalKey(name string, out any) error

UnmarshalKey reads a configuration section into a configuration object.

Jump to

Keyboard shortcuts

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