conf

package
v0.0.0-...-8e51596 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package conf provide config

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindPFlag

func BindPFlag(key string, flag *pflag.Flag) error

BindPFlag bind pflag

func Get

func Get(key string) interface{}

func GetBool

func GetBool(key string) bool

func GetDuration

func GetDuration(key string) time.Duration

func GetFloat64

func GetFloat64(key string) float64

func GetInt

func GetInt(key string) int

func GetInt32

func GetInt32(key string) int32

func GetInt64

func GetInt64(key string) int64

func GetRaftPort

func GetRaftPort() int

func GetString

func GetString(key string) string

func GetUint32

func GetUint32(key string) uint32

func InitConfig

func InitConfig(opts ...Option)

InitConfig set options to config

func Set

func Set(key string, value interface{})

func SetDefault

func SetDefault(key string, value interface{})

Types

type Conf

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

func New

func New(v *viper.Viper, opts ...Option) *Conf

func NewDefault

func NewDefault() *Conf

type Option

type Option func(*Conf)

func SetConfigFile

func SetConfigFile(file string) Option

func SetEnv

func SetEnv() Option

Jump to

Keyboard shortcuts

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