Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPBConfig

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

初始化Config方法

Types

type PBConfig

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

PBConfig 表示框架的配置文件服务

func (*PBConfig) Get

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

Get 获取某个配置项

func (*PBConfig) GetBool

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

GetBool 获取bool类型配置

func (*PBConfig) GetFloat64

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

GetFloat64 get float64

func (*PBConfig) GetInt

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

GetInt 获取int类型配置

func (*PBConfig) GetIntSlice

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

GetIntSlice get int slice type

func (*PBConfig) GetString

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

GetString get string typen

func (*PBConfig) GetStringMap

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

GetStringMap get map which key is string, value is interface

func (*PBConfig) GetStringMapString

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

GetStringMapString get map which key is string, value is string

func (*PBConfig) GetStringMapStringSlice

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

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

func (*PBConfig) GetStringSlice

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

GetStringSlice get string slice type

func (*PBConfig) GetTime

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

GetTime get time type

func (*PBConfig) IsExist

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

IsExist check setting is exist

func (*PBConfig) Load

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

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

type PBConfigProvider

type PBConfigProvider struct{}

func (*PBConfigProvider) Boot

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

Boot will called when the service instantiate

func (*PBConfigProvider) IsDefer

func (provider *PBConfigProvider) IsDefer() bool

IsDefer define whether the service instantiate when first make or register

func (*PBConfigProvider) Name

func (provider *PBConfigProvider) Name() string

/ Name define the name for this service

func (*PBConfigProvider) Params

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

Params define the necessary params for NewInstance

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