conf

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("no such key")

Functions

This section is empty.

Types

type Config

type Config struct {
	Values map[string]string
}

Config holds values read from file or any other

func ParseFile

func ParseFile(filename string) (*Config, error)

func ParseReader

func ParseReader(r io.Reader) *Config

func (*Config) Get added in v0.2.0

func (c *Config) Get(key string) (op Option)

func (*Config) Has added in v0.2.0

func (c *Config) Has(key string) (present bool)

type Option added in v0.2.0

type Option struct {
	Value string
	// contains filtered or unexported fields
}

func (Option) Bool added in v0.2.0

func (op Option) Bool() bool

func (Option) Int added in v0.2.0

func (op Option) Int() (int, error)

func (Option) String added in v0.2.0

func (op Option) String() (string, error)

Jump to

Keyboard shortcuts

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