mapper

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricsSubsystem = "params"
	ParamLabel       = "key"
)
View Source
const MapperName = "params"

Variables

This section is empty.

Functions

func BuildParamKey

func BuildParamKey(paramSpace string, key []byte) []byte

Types

type Mapper

type Mapper struct {
	*mapper.BaseMapper

	Metrics *Metrics
	// contains filtered or unexported fields
}

参数存储操作

func GetMapper

func GetMapper(ctx context.Context) *Mapper

func NewMapper

func NewMapper() *Mapper

func (*Mapper) Copy

func (mapper *Mapper) Copy() mapper.IMapper

func (Mapper) GetModuleParamSet

func (mapper Mapper) GetModuleParamSet(module string) (set qtypes.ParamSet, exists bool)

获取模块参数结构,并非保存在数据库中参数数据

func (Mapper) GetModuleParams

func (mapper Mapper) GetModuleParams(module string) (set qtypes.ParamSet, exists bool)

获取模块参数集

func (Mapper) GetParam

func (mapper Mapper) GetParam(paramSpace string, key string) (value interface{}, exists bool)

获取单个参数

func (Mapper) GetParamSet

func (mapper Mapper) GetParamSet(params qtypes.ParamSet)

获取参数集

func (Mapper) GetParams

func (mapper Mapper) GetParams() (params []qtypes.ParamSet)

获取所有参数

func (Mapper) RegisterParamSet

func (mapper Mapper) RegisterParamSet(ps ...qtypes.ParamSet)

参数注册

func (Mapper) SetParam

func (mapper Mapper) SetParam(paramSpace string, key string, value interface{})

设置单个参数

func (Mapper) SetParamSet

func (mapper Mapper) SetParamSet(params qtypes.ParamSet)

保存参数集

func (*Mapper) SetUpMetrics added in v0.0.8

func (mapper *Mapper) SetUpMetrics(cfg *config.InstrumentationConfig)

设置prometheus监控项

func (Mapper) UpdateMetrics added in v0.0.8

func (mapper Mapper) UpdateMetrics(paramSpace, key string, value interface{})

metrics

func (Mapper) Validate

func (mapper Mapper) Validate(paramSpace string, key string, value string) btypes.Error

参数校验

type Metrics added in v0.0.8

type Metrics struct {
	Param metrics.Gauge
}

func NopMetrics added in v0.0.8

func NopMetrics() *Metrics

func PrometheusMetrics added in v0.0.8

func PrometheusMetrics(cfg *config.InstrumentationConfig) *Metrics

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL