decoder

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOptions

func AddOptions(parser *argparse.Parser, cont DataContinuation)

func NewValidator

func NewValidator(decoder Decoder, cont DataContinuation) func(string) error

Types

type Data

type Data map[string]interface{}

type DataContinuation

type DataContinuation func(Data) error

type Decoder

type Decoder interface {
	Format() string
	Shortcut() string
	Decode(input []byte) (Data, error)
}

type EnvDecoder

type EnvDecoder struct{}

func (EnvDecoder) Decode

func (e EnvDecoder) Decode(input []byte) (Data, error)

func (EnvDecoder) Format

func (e EnvDecoder) Format() string

func (EnvDecoder) Shortcut

func (e EnvDecoder) Shortcut() string

type JsonDecoder

type JsonDecoder struct{}

func (JsonDecoder) Decode

func (j JsonDecoder) Decode(input []byte) (Data, error)

func (JsonDecoder) Format

func (j JsonDecoder) Format() string

func (JsonDecoder) Shortcut

func (j JsonDecoder) Shortcut() string

type TomlDecoder

type TomlDecoder struct{}

func (TomlDecoder) Decode

func (t TomlDecoder) Decode(input []byte) (Data, error)

func (TomlDecoder) Format

func (t TomlDecoder) Format() string

func (TomlDecoder) Shortcut

func (t TomlDecoder) Shortcut() string

type YamlDecoder

type YamlDecoder struct{}

func (YamlDecoder) Decode

func (y YamlDecoder) Decode(input []byte) (Data, error)

func (YamlDecoder) Format

func (y YamlDecoder) Format() string

func (YamlDecoder) Shortcut

func (y YamlDecoder) Shortcut() string

Jump to

Keyboard shortcuts

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