configparser

package
v0.0.0-...-978cf5a Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flags

func Flags(flags *pflag.FlagSet)

Flags adds flags related to basic configuration's parser loader to the flags.

Types

type Parser

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

Parser loads configuration.

func NewParserFromFile

func NewParserFromFile(fileName string) (*Parser, error)

NewParserFromFile creates a new Parser by reading the given file.

func (*Parser) UnmarshalExact

func (l *Parser) UnmarshalExact(intoCfg interface{}) error

UnmarshalExact unmarshals the config into a struct, erroring if a field is nonexistent.

type Provider

type Provider interface {
	// Get returns the Parser if succeed or error otherwise.
	Get() (*Parser, error)
}

Provider is config provider

func Default

func Default() Provider

Default is a default config provider

func NewFile

func NewFile() Provider

NewFile create file provider

Jump to

Keyboard shortcuts

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