common

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config ucfg.Config

Config object to store hierarchical configurations into. See https://godoc.org/github.com/elastic/go-ucfg#Config

func NewConfig

func NewConfig() *Config

func NewConfigFrom

func NewConfigFrom(from interface{}) (*Config, error)

NewConfigFrom creates a new Config object from the given input. From can be any kind of structured data(struct, map, array, slice).

func (*Config) Child

func (c *Config) Child(name string, idx int) (*Config, error)

func (*Config) Enabled

func (c *Config) Enabled() bool

func (*Config) GetFields

func (c *Config) GetFields() []string

func (*Config) HasField

func (c *Config) HasField(name string) bool

func (*Config) String

func (c *Config) String(name string, idx int) (string, error)

func (*Config) Unpack

func (c *Config) Unpack(to interface{}) error

type ConfigNamespace

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

ConfigNamespace storing at most one configuration section by name and sub-section.

func (*ConfigNamespace) Config

func (ns *ConfigNamespace) Config() *Config

func (*ConfigNamespace) IsSet

func (ns *ConfigNamespace) IsSet() bool

func (*ConfigNamespace) Name

func (ns *ConfigNamespace) Name() string

func (*ConfigNamespace) Unpack

func (ns *ConfigNamespace) Unpack(cfg *Config) error

Unpack unpacks a configuration with at most one sub object. An sub object is ignored if it is disabled by setting `enabled: false`. If the configuration passed contains multiple active sub objects, Unpack will return an error.

Directories

Path Synopsis
Package atomic provides common primitive types with atomic accessors.
Package atomic provides common primitive types with atomic accessors.

Jump to

Keyboard shortcuts

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