config

package
v0.0.1-alpha Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOneConfig

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

NewOneConfig 初始化Config方法

Types

type OneConfig

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

OneConfig 表示one框架的配置文件服务

func (*OneConfig) Get

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

Get 获取某个配置项

func (*OneConfig) GetBool

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

GetBool 获取bool类型配置

func (*OneConfig) GetFloat64

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

GetFloat64 get float64

func (*OneConfig) GetInt

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

GetInt 获取int类型配置

func (*OneConfig) GetIntSlice

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

GetIntSlice get int slice type

func (*OneConfig) GetString

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

GetString get string typen

func (*OneConfig) GetStringMap

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

GetStringMap get map which key is string, value is interface

func (*OneConfig) GetStringMapString

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

GetStringMapString get map which key is string, value is string

func (*OneConfig) GetStringMapStringSlice

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

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

func (*OneConfig) GetStringSlice

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

GetStringSlice get string slice type

func (*OneConfig) GetTime

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

GetTime get time type

func (*OneConfig) IsExist

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

IsExist check setting is exist

func (*OneConfig) Load

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

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

type OneConfigProvider

type OneConfigProvider struct{}

func (*OneConfigProvider) Boot

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

Boot will called when the service instantiate

func (*OneConfigProvider) IsDefer

func (provider *OneConfigProvider) IsDefer() bool

IsDefer define whether the service instantiate when first make or register

func (*OneConfigProvider) Name

func (provider *OneConfigProvider) Name() string

/ Name define the name for this service

func (*OneConfigProvider) Params

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

Params define the necessary params for NewInstance

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