kpkeyval

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package kpkeyval provides a key value parser to parse an io.Reader's content of key/values with a configurable separator and add it into a konfig.Store.

Index

Constants

View Source
const DefaultSep = "="

DefaultSep is the default key value separator

Variables

View Source
var (
	ErrInvalidConfigFileFormat = errors.New("Err invalid file format")
)

ErrInvalidConfigFileFormat is the error returned when a problem is encountered when parsing the config file

Functions

This section is empty.

Types

type Config

type Config struct {
	// Sep is the separator between keys and values
	Sep string
}

Config is the configuration of the key value parser

type Parser

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

Parser implements fileloader.Parser It parses a file of key/values with a specific separator and stores in the konfig.Store

func New

func New(cfg *Config) *Parser

New creates a new parser with the given config

func (*Parser) Parse

func (k *Parser) Parse(r io.Reader, cfg konfig.Values) error

Parse implement the fileloader.Parser interface

Jump to

Keyboard shortcuts

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