yaml

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider is a config provider that reads from a yaml file or io.Reader and scans into the specified struct.

func New

func New() *Provider

New is the default way to create a yaml Provider. The entire file is read when New is called and a reader created from the buffer. If there is an error reading the file it is stored in Provider and returned during Parse.

func WithPath

func WithPath(path string) *Provider

WithPath allows for a non-standard configuration file to be specified at runtime. If there is an error reading the file it is stored in Provider and returned during Parse.

func WithReader

func WithReader(r io.Reader) *Provider

WithReader accepts a reader and returns a yaml Provider.

func (*Provider) Parse

func (p *Provider) Parse(i interface{}) error

Parse implements the config.Provider interface.

Jump to

Keyboard shortcuts

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