sourcefile

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

File implements configue.Source to fetch values from a file.

func NewSource

func NewSource(path string, opts ...Option) *File

NewSource returns a new file source.

func (*File) Name

func (f *File) Name() string

Name implements configue.Source interface.

func (*File) Unmarshal

func (f *File) Unmarshal(to interface{}) error

Unmarshal tries to unmarshal file to the provided interface. It returns a trivial error if load strictness is false, or the true error otherwise.

type Option

type Option func(f *File)

Option defines the function signature to apply options.

func FailOnUnknownFields

func FailOnUnknownFields() Option

FailOnUnknownFields tells the file decoder to fail if a key exists in the file but not in the destination.

func MayNotExist

func MayNotExist() Option

MayNotExist tells the file.Unmarshal function to return a that implements IsTrivial when file does not exists.

Jump to

Keyboard shortcuts

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