viper

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: MIT Imports: 9 Imported by: 9

README

GoZix Viper

Documentation

Overview

Package viper provide viper bundle.

Index

Constants

View Source
const (
	// BundleName is default definition name.
	BundleName = "viper"

	// DefConfigFlag is config persistent flag name.
	DefConfigFlag = "cli.persistent_flags.config"
)

Variables

View Source
var (
	// ErrUndefinedAppPath is error, triggered when app.path is undefined in current context.
	ErrUndefinedAppPath = errors.New("app.path is undefined")

	// ErrUndefinedCliCmd is error, triggered when cli.cmd is undefined in current context.
	ErrUndefinedCliCmd = errors.New("cli.cmd is undefined")
)

Functions

This section is empty.

Types

type Bundle

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

Bundle implements the glue.Bundle interface.

func NewBundle

func NewBundle() *Bundle

NewBundle create bundle instance.

func NewBundleWithConfig

func NewBundleWithConfig(options ...Option) *Bundle

NewBundleWithConfig create bundle instance with config.

func (*Bundle) Build

func (b *Bundle) Build(builder *di.Builder) error

Build implements the glue.Bundle interface.

func (*Bundle) Name

func (b *Bundle) Name() string

Name implements the glue.Bundle interface.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option interface.

func AutomaticEnv

func AutomaticEnv() Option

AutomaticEnv option.

func ConfigFile

func ConfigFile(value string) Option

ConfigFile option.

func ConfigName

func ConfigName(value string) Option

ConfigName option.

func ConfigPath

func ConfigPath(value string) Option

ConfigPath option.

func ConfigType

func ConfigType(value string) Option

ConfigType option.

func EnvKeyReplacer

func EnvKeyReplacer(value *strings.Replacer) Option

EnvKeyReplacer option.

func EnvPrefix

func EnvPrefix(value string) Option

EnvPrefix option.

type Viper

type Viper = viper.Viper

Viper is type alias of viper.Viper

Jump to

Keyboard shortcuts

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