config

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewYgoConfig

func NewYgoConfig(params ...interface{}) (interface{}, error)

Types

type YgoConfig

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

func (*YgoConfig) Get

func (conf *YgoConfig) Get(key string) interface{}

Get 获取某个配置项

func (*YgoConfig) GetBool

func (conf *YgoConfig) GetBool(key string) bool

GetBool 获取bool类型配置

func (*YgoConfig) GetFloat64

func (conf *YgoConfig) GetFloat64(key string) float64

GetFloat64 get float64

func (*YgoConfig) GetInt

func (conf *YgoConfig) GetInt(key string) int

GetInt 获取int类型配置

func (*YgoConfig) GetIntSlice

func (conf *YgoConfig) GetIntSlice(key string) []int

GetIntSlice get int slice type

func (*YgoConfig) GetString

func (conf *YgoConfig) GetString(key string) string

GetString get string typen

func (*YgoConfig) GetStringMap

func (conf *YgoConfig) GetStringMap(key string) map[string]interface{}

GetStringMap get map which key is string, value is interface

func (*YgoConfig) GetStringMapString

func (conf *YgoConfig) GetStringMapString(key string) map[string]string

GetStringMapString get map which key is string, value is string

func (*YgoConfig) GetStringMapStringSlice

func (conf *YgoConfig) GetStringMapStringSlice(key string) map[string][]string

GetStringMapStringSlice get map which key is string, value is string slice

func (*YgoConfig) GetStringSlice

func (conf *YgoConfig) GetStringSlice(key string) []string

GetStringSlice get string slice type

func (*YgoConfig) GetTime

func (conf *YgoConfig) GetTime(key string) time.Time

GetTime get time type

func (*YgoConfig) IsExist

func (conf *YgoConfig) IsExist(key string) bool

IsExist check setting is exist

func (*YgoConfig) Load

func (conf *YgoConfig) Load(key string, val interface{}) error

Load a config to a struct, val should be an pointer

type YgoConfigProvider

type YgoConfigProvider struct {
}

func (*YgoConfigProvider) Boot

func (provider *YgoConfigProvider) Boot(c framework.Container) error

Boot will called when the service instantiate

func (*YgoConfigProvider) IsDefer

func (provider *YgoConfigProvider) IsDefer() bool

IsDefer define whether the service instantiate when first make or register

func (*YgoConfigProvider) Name

func (provider *YgoConfigProvider) Name() string

/ Name define the name for this service

func (*YgoConfigProvider) Params

func (provider *YgoConfigProvider) Params(c framework.Container) []interface{}

Params define the necessary params for NewInstance

func (*YgoConfigProvider) Register

Register registe a new function for make a service instance

Jump to

Keyboard shortcuts

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