config

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHeroConfig

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

NewHeroConfig 初始化Config方法

Types

type HeroConfig

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

HeroConfig 表示hero框架的配置文件服务

func (*HeroConfig) Get

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

Get 获取某个配置项

func (*HeroConfig) GetBool

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

GetBool 获取bool类型配置

func (*HeroConfig) GetFloat64

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

GetFloat64 get float64

func (*HeroConfig) GetInt

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

GetInt 获取int类型配置

func (*HeroConfig) GetIntSlice

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

GetIntSlice get int slice type

func (*HeroConfig) GetString

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

GetString get string typen

func (*HeroConfig) GetStringMap

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

GetStringMap get map which key is string, value is interface

func (*HeroConfig) GetStringMapString

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

GetStringMapString get map which key is string, value is string

func (*HeroConfig) GetStringMapStringSlice

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

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

func (*HeroConfig) GetStringSlice

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

GetStringSlice get string slice type

func (*HeroConfig) GetTime

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

GetTime get time type

func (*HeroConfig) IsExist

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

IsExist check setting is exist

func (*HeroConfig) Load

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

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

type HeroConfigProvider

type HeroConfigProvider struct{}

func (*HeroConfigProvider) Boot

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

Boot will called when the service instantiate

func (*HeroConfigProvider) IsDefer

func (provider *HeroConfigProvider) IsDefer() bool

IsDefer define whether the service instantiate when first make or register

func (*HeroConfigProvider) Name

func (provider *HeroConfigProvider) Name() string

/ Name define the name for this service

func (*HeroConfigProvider) Params

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

Params define the necessary params for NewInstance

func (*HeroConfigProvider) 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