goconf

package module
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

README

goconf

An easy go configuration helper with powerful features.

Documentation

Index

Constants

View Source
const Undef = Origin("undef")

Variables

View Source
var ErrKeyNotFound = errors.New("key not found")

ErrKeyNotFound when key is not found.

View Source
var ErrUnexpectedType = errors.New("unexpected type")

ErrUnexpectedType when conf value does not match expected type.

Functions

func NewErrKeyNotFound

func NewErrKeyNotFound(key string) error

func V

func V[T any](v T) *T

Types

type Binder

type Binder interface {
	Bind(key string, set bool, dstType reflect.Type, dstValue *reflect.Value) (Origin, string, error)
}

type CheckedConfig

type CheckedConfig struct{}

CheckedConfig is dummy

type ErrorCollector

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

func NewErrorCollector

func NewErrorCollector() *ErrorCollector

func (*ErrorCollector) Push

func (c *ErrorCollector) Push(err error)

type Filler

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

Filler is dummy...

func NewRegistry

func NewRegistry(
	_ *CheckedConfig,
	layers Layers,
) (
	*Filler,
	error,
)

NewRegistry is dummy

func (*Filler) Fill

func (r *Filler) Fill(i interface{}) error

Fill is dummy....

type KVString

type KVString interface {
	GetStringValue(key string) (string, string, error)
	GetID() Origin
}

type Layers

type Layers []Binder

Layers is dummy...

type Origin

type Origin string

type Report

type Report []ReportEntry

type ReportEntry

type ReportEntry struct {
	Key    string
	Idx    int
	Errors []error
}

Directories

Path Synopsis
providers
tests
cmd

Jump to

Keyboard shortcuts

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