config

package
v1.120.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultDevConfigFile is the name of the default dev configuration file.
	DefaultDevConfigFile = "dev-config.yaml"
)

Variables

This section is empty.

Functions

func KeyNamespaceMutator

func KeyNamespaceMutator(ns string) func(key string) string

KeyNamespaceMutator returns a mutator that prefixes a namespace to the key with a `.` delimiter.

Types

type AppDev

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

func New

func New(path string) (*AppDev, error)

func (*AppDev) Components

func (c *AppDev) Components(component string) ConfigSource

func (*AppDev) GetBool

func (c *AppDev) GetBool(key string) bool

func (*AppDev) GetDuration

func (c *AppDev) GetDuration(key string) time.Duration

func (*AppDev) GetString

func (c *AppDev) GetString(key string) string

func (*AppDev) IsSet

func (c *AppDev) IsSet(key string) bool

func (*AppDev) Set

func (c *AppDev) Set(key string, value any) error

func (*AppDev) WriteConfig

func (c *AppDev) WriteConfig() error

type ConfigSource

type ConfigSource interface {
	IsSet(key string) bool
	GetString(key string) string
	GetBool(key string) bool
	GetDuration(key string) time.Duration
}

ConfigSource is a config source.

func DoctlConfigSource

func DoctlConfigSource(config doctl.Config, ns string) ConfigSource

DoctlConfigSource converts a doctl.Config into a ConfigSource with an optional default namespace.

func Multi

func Multi(sources ...ConfigSource) ConfigSource

Multi returns a config source that wraps multiple config sources. Each source is evaluated in order and the first match is returned.

func MutatingConfigSource

func MutatingConfigSource(cs ConfigSource, mutateKey func(key string) string, excludeMethods []string) ConfigSource

Jump to

Keyboard shortcuts

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