settings

package
v0.0.0-...-ee4ab76 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamespaceVariableSeparator = ":"
)

Variables

This section is empty.

Functions

func IsRegistered

func IsRegistered(provider string) bool

Checks to see if a provider is registered

func Value

func Value(setting string) (any, bool)

Returns the value for a setting. The setting must be in Provider:Name format

Types

type Provider

type Provider interface {
	GetSetting(name string) (value any, found bool)
}

func Cons

func Cons(head Provider, tail Provider) Provider

Combines 2 providers into 1. When looking up a setting the head is checked first. If not found then the tail is checked

func FromMap

func FromMap(data map[string]string) Provider

Creates a settings provider from a map. A copy of the map is made

func GetProvider

func GetProvider(name string) Provider

func NameValue

func NameValue(name string, value string) Provider

Creates a provider that has a single setting

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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