decoder

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTemplate

func ApplyTemplate(d *Decoder, input string) (string, error)

func FuncMap

func FuncMap(d *Decoder) template.FuncMap

Types

type ConfigError

type ConfigError string
const (
	ErrUnexpectedType ConfigError = "unexpected type"
	ErrUnexpectedKey  ConfigError = "unexpected key"
)

func (ConfigError) Error

func (e ConfigError) Error() string

type Decoder

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

func New

func New(filename string) *Decoder

func (*Decoder) DecodeYaml

func (d *Decoder) DecodeYaml(content []byte, target interface{}, lookup map[string]Decoding)

func (*Decoder) Error

func (d *Decoder) Error(err error)

func (*Decoder) Errors

func (d *Decoder) Errors() []error

func (*Decoder) Run

func (d *Decoder) Run(name string, decode Decoding, value interface{})

type Decoding

type Decoding func(*Decoder, interface{})

func Bool

func Bool(target interface{}) Decoding

func Int

func Int(target interface{}) Decoding

func Keys

func Keys(lookup map[string]Decoding) Decoding

func Kinds

func Kinds(lookup map[reflect.Kind]Decoding) Decoding

func Map

func Map(produce Producer, target interface{}) Decoding

func Singleton

func Singleton(produce Producer, target interface{}) Decoding

func Slice

func Slice(produce Producer, target interface{}) Decoding

func String

func String(target interface{}) Decoding

type Producer

type Producer func() (interface{}, Decoding)

func NewBool

func NewBool() Producer

func NewInt

func NewInt() Producer

func NewString

func NewString() Producer

Jump to

Keyboard shortcuts

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