conf

package
v1.30.36 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DevMode added in v1.30.30

func DevMode(field string)

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, v interface{})

func ProjectPath added in v1.30.3

func ProjectPath() (path string)

ProjectPath return project path

func Unmarshal added in v1.30.31

func Unmarshal(v interface{})

Types

type Config

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

func Configger

func Configger(params ...string) *Config

Configger single config

func NewConfig

func NewConfig(params ...string) *Config

NewConfig new Config load all devMode yaml data

func (*Config) Get

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

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

func (*Config) GetBool

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

func (*Config) GetInt

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

func (*Config) GetString

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

func (*Config) GetStruct

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

GetStruct yaml to struct only support Accessible Field

func (*Config) Unmarshal added in v1.30.30

func (c *Config) Unmarshal(s interface{})

type Yaml

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

func (*Yaml) Get

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

func (*Yaml) GetBool

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

func (*Yaml) GetInt

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

func (*Yaml) GetString

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

func (*Yaml) Unmarshal added in v1.30.30

func (c *Yaml) Unmarshal(data interface{}, s interface{})

Jump to

Keyboard shortcuts

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