config

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Unlicense Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Concrete

type Concrete struct {
	Bool     func() bool
	Duration func() time.Duration
	Float    func() float64
	Integer  func() int64
	List     func() []string
	Text     func() string
}

Concrete is a struct of functions that return the concrete values. Only the intended type will return a value, the rest always return zero.

func NewConcrete

func NewConcrete() Concrete

NewConcrete provides a Concrete with all functions returning zero values

type Option

type Option interface {
	FromString(s string) (e error)
	String() (s string)
	Expanded() (s string)
	SetExpanded(s string)
	Value() (c Concrete)
	Type() (t meta.Type)
	Meta() (md meta.Metadata)
	RunHooks() (err error)
	Path() (p path.Path)
	SetPath(p path.Path)
}

Option interface reads and writes string formats for options and returns a Concrete value to the appropriate concrete value, with the type indicated.

type Opts

type Opts map[string]Option

Jump to

Keyboard shortcuts

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