textconf

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TextConfig

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

func FromCmdLine

func FromCmdLine() (*TextConfig, error)

命令行参数为配置文件路径

func FromEnv

func FromEnv(env string) (*TextConfig, error)

环境变量值为配置文件路径

func FromFile

func FromFile(szCfgFile string) (*TextConfig, error)

直接加载配置文件

func FromString

func FromString(szContent []byte) (*TextConfig, error)

func (*TextConfig) GetConfBool

func (this *TextConfig) GetConfBool(key string) bool

func (*TextConfig) GetConfFile

func (this *TextConfig) GetConfFile() string

func (*TextConfig) GetConfFloat64

func (this *TextConfig) GetConfFloat64(key string) float64

func (*TextConfig) GetConfInt

func (this *TextConfig) GetConfInt(key string) int64

func (*TextConfig) GetConfString

func (this *TextConfig) GetConfString(key string) string

func (*TextConfig) MustGetConfString

func (this *TextConfig) MustGetConfString(key string, def string) string

func (*TextConfig) SaveTo

func (this *TextConfig) SaveTo(w io.Writer) error

func (*TextConfig) SaveToFile

func (this *TextConfig) SaveToFile(fname string) error

func (*TextConfig) SetConfBool

func (this *TextConfig) SetConfBool(key string, value bool)

func (*TextConfig) SetConfInt

func (this *TextConfig) SetConfInt(key string, value int64)

func (*TextConfig) SetConfString

func (this *TextConfig) SetConfString(key string, value string)

func (*TextConfig) TryGetConfString

func (this *TextConfig) TryGetConfString(key string) string

Jump to

Keyboard shortcuts

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