config

package
v0.0.0-...-8746e94 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFlyConfig

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

NewFlyConfig 初始化Config方法

Types

type FlyConfig

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

FlyConfig 表示fly框架的配置文件服务

func (*FlyConfig) Get

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

Get 获取某个配置项

func (*FlyConfig) GetBool

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

GetBool 获取bool类型配置

func (*FlyConfig) GetFloat64

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

GetFloat64 get float64

func (*FlyConfig) GetInt

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

GetInt 获取int类型配置

func (*FlyConfig) GetIntSlice

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

GetIntSlice get int slice type

func (*FlyConfig) GetString

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

GetString get string typen

func (*FlyConfig) GetStringMap

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

GetStringMap get map which key is string, value is interface

func (*FlyConfig) GetStringMapString

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

GetStringMapString get map which key is string, value is string

func (*FlyConfig) GetStringMapStringSlice

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

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

func (*FlyConfig) GetStringSlice

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

GetStringSlice get string slice type

func (*FlyConfig) GetTime

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

GetTime get time type

func (*FlyConfig) IsExist

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

IsExist check setting is exist

func (*FlyConfig) Load

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

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

type FlyConfigProvider

type FlyConfigProvider struct{}

func (*FlyConfigProvider) Boot

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

Boot will called when the service instantiate

func (*FlyConfigProvider) IsDefer

func (provider *FlyConfigProvider) IsDefer() bool

IsDefer define whether the service instantiate when first make or register

func (*FlyConfigProvider) Name

func (provider *FlyConfigProvider) Name() string

/ Name define the name for this service

func (*FlyConfigProvider) Params

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

Params define the necessary params for NewInstance

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