storage

package
v0.3.2-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: GPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetOperatorData added in v0.2.0

type GetOperatorData = func(index uint64) (*OperatorData, bool, error)

GetOperatorData is a function that returns the operator data

type OperatorData added in v0.2.0

type OperatorData struct {
	Index        uint64         `json:"index"`
	PublicKey    string         `json:"publicKey"`
	Name         string         `json:"name"`
	OwnerAddress common.Address `json:"ownerAddress"`
}

OperatorData the public data of an operator

type OperatorsCollection

type OperatorsCollection interface {
	GetOperatorDataByPubKey(operatorPubKey string) (*OperatorData, bool, error)
	GetOperatorData(index uint64) (*OperatorData, bool, error)
	SaveOperatorData(operatorData *OperatorData) error
	DeleteOperatorData(index uint64) error
	ListOperators(from uint64, to uint64) ([]OperatorData, error)
	GetOperatorsPrefix() []byte
}

OperatorsCollection is the interface for managing operators data

func NewOperatorsStorage

func NewOperatorsStorage(db basedb.IDb, logger *zap.Logger, prefix []byte) OperatorsCollection

NewOperatorsStorage creates a new instance of Storage

Jump to

Keyboard shortcuts

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