file

package
v0.0.0-...-9601d62 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package file provides config file support for uconfig

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File interface {
	Walk(conf interface{}) error
	Parse() error
}

File is a file loader plugin for uconfig

func New

func New(path string, unmarshal Unmarshal) File

New returns an EnvSet.

func NewReader

func NewReader(src io.Reader, unmarshal Unmarshal) File

NewReader returns a uconfig plugin that unmarshals the content of the provided io.Reader into the config using the provided unmarshal function. The src will be closed if it is an io.Closer.

type Unmarshal

type Unmarshal func(src []byte, v interface{}) error

Unmarshal is any function that maps the source bytes to the provided config.

Jump to

Keyboard shortcuts

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