config

package
v0.0.0-...-2552c51 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterParseMethod

func RegisterParseMethod(name string, method ParseMethod)

Types

type Config

type Config interface {
	AppendSection(name string) (newSection Section)
	Section(name string) (Section, bool)
	Sections(name string) ([]Section, bool)
	ValueSetup(name string, ptr interface{}) bool
	Value(name string) (value.Value, bool)
	ValueDefault(name string, defaultVal interface{}) interface{}
	Save(io.Writer) error
}

func FromFile

func FromFile(methodName, filePath string) (res Config, err error)

func FromReader

func FromReader(methodName string, r io.Reader) (res Config, err error)

type ParseMethod

type ParseMethod func(r io.Reader) (Config, error)

type Section

type Section interface {
	ValueSetup(name string, ptr interface{}) bool
	Value(name string) (value.Value, bool)
	ValueDefault(name string, defaultVal interface{}) interface{}
	SetValue(name string, value interface{})
	Save(io.Writer) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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