config

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFakeConfig

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

func NewGinxConfig

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

NewGinxConfig 初始化Config方法

Types

type FakeConfig

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

func (*FakeConfig) Get

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

Get a new interface

func (*FakeConfig) GetBool

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

GetBool get bool type

func (*FakeConfig) GetFloat64

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

GetFloat64 get float64

func (*FakeConfig) GetInt

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

GetInt get Int type

func (*FakeConfig) GetIntSlice

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

GetIntSlice get int slice type

func (*FakeConfig) GetString

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

GetString get string typen

func (*FakeConfig) GetStringMap

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

GetStringMap get map which key is string, value is interface

func (*FakeConfig) GetStringMapString

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

GetStringMapString get map which key is string, value is string

func (*FakeConfig) GetStringMapStringSlice

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

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

func (*FakeConfig) GetStringSlice

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

GetStringSlice get string slice type

func (*FakeConfig) GetTime

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

GetTime get time type

func (*FakeConfig) IsExist

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

IsExist check setting is exist

func (*FakeConfig) Load

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

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

type FakeConfigProvider

type FakeConfigProvider struct {
	FileName string
	Content  []byte
}

func (*FakeConfigProvider) Boot

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

Boot will called when the service instantiate

func (*FakeConfigProvider) IsDefer

func (provider *FakeConfigProvider) IsDefer() bool

IsDefer define whether the service instantiate when first make or register

func (*FakeConfigProvider) Name

func (provider *FakeConfigProvider) Name() string

Name define the name for this service

func (*FakeConfigProvider) Params

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

Params define the necessary params for NewInstance

func (*FakeConfigProvider) Register

Register registe a new function for make a service instance

type GinxConfig

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

GinxConfig 表示ginx框架的配置文件服务

func (*GinxConfig) Get

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

Get 获取某个配置项

func (*GinxConfig) GetBool

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

GetBool 获取bool类型配置

func (*GinxConfig) GetFloat64

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

GetFloat64 get float64

func (*GinxConfig) GetInt

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

GetInt 获取int类型配置

func (*GinxConfig) GetIntSlice

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

GetIntSlice get int slice type

func (*GinxConfig) GetString

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

GetString get string typen

func (*GinxConfig) GetStringMap

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

GetStringMap get map which key is string, value is interface

func (*GinxConfig) GetStringMapString

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

GetStringMapString get map which key is string, value is string

func (*GinxConfig) GetStringMapStringSlice

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

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

func (*GinxConfig) GetStringSlice

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

GetStringSlice get string slice type

func (*GinxConfig) GetTime

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

GetTime get time type

func (*GinxConfig) IsExist

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

IsExist check setting is exist

func (*GinxConfig) Load

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

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

type GinxConfigProvider

type GinxConfigProvider struct{}

func (*GinxConfigProvider) Boot

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

Boot will called when the service instantiate

func (*GinxConfigProvider) IsDefer

func (provider *GinxConfigProvider) IsDefer() bool

IsDefer define whether the service instantiate when first make or register

func (*GinxConfigProvider) Name

func (provider *GinxConfigProvider) Name() string

/ Name define the name for this service

func (*GinxConfigProvider) Params

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

Params define the necessary params for NewInstance

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