viper

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ViperKey corresponds to viper configuration
	ViperKey = "viper"
	// FilePath the path to store the config file
	FilePath = "filepath"
	// FileType the type of the config file
	FileType = "filetype"
	// FileName the name of the config file
	FileName = "filename"
)

Variables

This section is empty.

Functions

func New

func New(opts Options) (config.Handler, error)

NewViper returns a new instance of a Viper configuration provider using the provided Options opts.

Types

type Options

type Options struct {
	FilePath string
	FileType string
	FileName string
}

Options contains config options for various aspects of viper instance.

type Viper

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

Viper implements the config interface Handler for a Viper configuration registry.

func (*Viper) GetAll

func (v *Viper) GetAll(result interface{}) error

GetAll implements GetAll functionality of the interface

func (*Viper) GetKey

func (v *Viper) GetKey(key string) string

GetKey implements GetKey functionality of the interface

func (*Viper) GetObject

func (v *Viper) GetObject(key string, result interface{}) error

GetObject implements GetObject functionality of the interface

func (*Viper) Is

func (v *Viper) Is(key string) bool

Is implements Is functionality of the interface

func (*Viper) SetKey

func (v *Viper) SetKey(key string, value string)

SetKey implements SetKey functionality of the interface

func (*Viper) SetObject

func (v *Viper) SetObject(key string, value interface{}) error

SetObject implements SetObject functionality of the interface

Jump to

Keyboard shortcuts

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