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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricsSubsystem = "guardian"
	OperationLabel   = "operation"
	AddressLabel     = "address"
)
View Source
const (
	MapperName = "guardian"
)

Variables

This section is empty.

Functions

func KeyGuardian

func KeyGuardian(address btypes.AccAddress) []byte

系统账户存储键

func KeyGuardiansSubspace

func KeyGuardiansSubspace() []byte

系统账户存储前缀

Types

type Mapper

type Mapper struct {
	*mapper.BaseMapper

	Metrics *Metrics
}

系统账户模块数据库操作

func GetMapper

func GetMapper(ctx context.Context) *Mapper

func NewMapper

func NewMapper() *Mapper

func (Mapper) AddGuardian

func (mapper Mapper) AddGuardian(guardian types.Guardian)

添加系统账户

func (*Mapper) Copy

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

func (Mapper) DeleteGuardian

func (mapper Mapper) DeleteGuardian(address btypes.AccAddress)

删除系统账户

func (Mapper) GetGuardian

func (mapper Mapper) GetGuardian(address btypes.AccAddress) (guardian types.Guardian, exists bool)

获取系统账户

func (Mapper) GetHalt added in v0.0.8

func (mapper Mapper) GetHalt() (string, bool)

查询停止网络标志

func (Mapper) GuardiansIterator

func (mapper Mapper) GuardiansIterator() store.Iterator

系统账户迭代器

func (Mapper) SetHalt

func (mapper Mapper) SetHalt(reason string)

设置停网标识

func (*Mapper) SetUpMetrics added in v0.0.8

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

设置prometheus监控项

type Metrics added in v0.0.8

type Metrics struct {
	Guardian metrics.Gauge // guardian operations
}

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