conf

package module
v0.0.0-...-4fe9819 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 7 Imported by: 3

README

go_conf

Packaging viper for daily multi-environment configuration

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Confhub

type Confhub struct {
	Core *viper.Viper
	// contains filtered or unexported fields
}

func New

func New(file string, opt ...func(o *Options)) *Confhub

func (*Confhub) AllKeys

func (c *Confhub) AllKeys() []string

func (*Confhub) ConfigChange

func (c *Confhub) ConfigChange(fn func(e fsnotify.Event))

func (*Confhub) Exist

func (c *Confhub) Exist() bool

func (*Confhub) Get

func (c *Confhub) Get(key string) (value ztype.Type)

func (*Confhub) GetAll

func (c *Confhub) GetAll(force ...bool) ztype.Map

func (*Confhub) Path

func (c *Confhub) Path() string

func (*Confhub) Read

func (c *Confhub) Read() (err error)

func (*Confhub) Set

func (c *Confhub) Set(key string, value interface{})

func (*Confhub) SetDefault

func (c *Confhub) SetDefault(key string, value interface{})

func (*Confhub) Unmarshal

func (c *Confhub) Unmarshal(rawVal interface{}, force ...bool) error

func (*Confhub) UnmarshalKey

func (c *Confhub) UnmarshalKey(key string, rawVal interface{}, force ...bool) error

func (*Confhub) Write

func (c *Confhub) Write(filepath ...string) error

type Options

type Options struct {
	FileName     string
	AutomaticEnv bool
	EnvPrefix    string
	AutoCreate   bool
	PrimaryAliss string
}

Jump to

Keyboard shortcuts

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