config

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package config provides configuration functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CSVFile string     `name:"csv-file" short:"c" description:"input csv file name"`
	OutFile string     `name:"out-file" short:"o" description:"output file name. Use yaml or json based on the required format."`
	Debug   bool       `name:"debug" short:"d" description:"print detailed logs for errors"`
	YAML    bool       `name:"yaml" description:"marshal to yaml instead of json"`
	Values  csv.Config `name:"values"`
}

Config represents the configuration

type Manager

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

Manager is the configuration manager.

func New

func New(name string) *Manager

New returns a new initialized manager with the given config.

func (*Manager) Flags

func (mgr *Manager) Flags() *pflag.FlagSet

Flags returns pflag.FlagSet.

func (*Manager) InitFlags

func (mgr *Manager) InitFlags(cfg Config) error

InitFlags initializes the flagset with the provided config.

func (*Manager) Unmarshal

func (mgr *Manager) Unmarshal(config interface{}) error

Unmarshal unmarshals the read config into the provided struct.

func (*Manager) Viper

func (mgr *Manager) Viper() *viper.Viper

Viper returns viper.

Jump to

Keyboard shortcuts

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