conf

package
v1.20.8 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBool

func GetBool(name string) bool

func GetInt

func GetInt(name string) int

func GetString

func GetString(name string) string

func GetStruct

func GetStruct(name string, s interface{})

yaml to struct only support Accessible Field

Types

type Config

type Config struct {
	// different devMode yaml data
	YamlS map[string]*Yaml
	// contains filtered or unexported fields
}

config

func Configger

func Configger(params ...string) *Config

single config

func NewConfig

func NewConfig(params ...string) *Config

new Config load all devMode yaml data

func (*Config) Get

func (c *Config) Get(name string) interface{}

get yaml data find the first data, must different from app.yaml

func (*Config) GetBool

func (c *Config) GetBool(name string) bool

func (*Config) GetInt

func (c *Config) GetInt(name string) int

func (*Config) GetString

func (c *Config) GetString(name string) string

func (*Config) GetStruct

func (c *Config) GetStruct(name string, s interface{})

yaml to struct only support Accessible Field

type Yaml

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

go tool yaml use go-yaml

func (*Yaml) Get

func (c *Yaml) Get(name string) interface{}

从配置文件中获取值

func (*Yaml) GetBool

func (c *Yaml) GetBool(name string) bool

bool

func (*Yaml) GetInt

func (c *Yaml) GetInt(name string) int

int

func (*Yaml) GetString

func (c *Yaml) GetString(name string) string

string

func (*Yaml) GetStruct

func (c *Yaml) GetStruct(name string, s interface{})

从配置文件中获取Struct类型的值 这里的struct是你自己定义的根据配置文件

Jump to

Keyboard shortcuts

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