config

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromJSON

func FromJSON(data interface{}, target interface{}) error

func FromYAML

func FromYAML(data interface{}, target interface{}) error

func NewConfig

func NewConfig(data interface{}, target interface{}) error

NewConfig will create process the data and will fill the target with the values supplied. For the data object, this function supports YAML, JSON, the target type, and a pointer to the target type.

func ToJSON

func ToJSON(c interface{}) (string, error)

func ToYAML

func ToYAML(c interface{}) (string, error)

Types

type DataParseError

type DataParseError struct {
	Err error
}

func (*DataParseError) Error

func (e *DataParseError) Error() string

func (*DataParseError) Unwrap

func (e *DataParseError) Unwrap() error

type Error

type Error struct {
	Err error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Exporter

type Exporter interface {
	JSONExporter
	YAMLExporter
	Stringer
}

type Importer

type Importer interface {
	JSONImporter
	YAMLImporter
}

type InvalidArgumentError

type InvalidArgumentError struct {
	Err error
}

func (*InvalidArgumentError) Error

func (e *InvalidArgumentError) Error() string

func (*InvalidArgumentError) Unwrap

func (e *InvalidArgumentError) Unwrap() error

type JSONExporter

type JSONExporter interface {
	JSON() (string, error)
}

type JSONImporter

type JSONImporter interface {
	FromJSON(in string) error
}

type Stringer

type Stringer interface {
	String() string
}

type YAMLExporter

type YAMLExporter interface {
	YAML() (string, error)
}

type YAMLImporter

type YAMLImporter interface {
	FromYAML(in string) error
}

Jump to

Keyboard shortcuts

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