record

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GatewayRecord

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

func (*GatewayRecord) GetAllGatewayAddrs

func (g *GatewayRecord) GetAllGatewayAddrs() []string

func (*GatewayRecord) SaveGatewayRecord

func (g *GatewayRecord) SaveGatewayRecord(account, addr string)

type GatewayRecorder

type GatewayRecorder interface {
	SaveGatewayRecord(account, addr string)
	GetAllGatewayAddrs() []string
}

func NewGatewayRecord

func NewGatewayRecord() GatewayRecorder

type MinerRecord

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

func (*MinerRecord) AddToBlacklist

func (m *MinerRecord) AddToBlacklist(account, addr, reason string)

func (*MinerRecord) AddToWhitelist

func (m *MinerRecord) AddToWhitelist(account string, info Minerinfo)

func (*MinerRecord) BackupBlacklist

func (m *MinerRecord) BackupBlacklist(path string) error

func (*MinerRecord) BackupMinerlist

func (m *MinerRecord) BackupMinerlist(path string) error

func (*MinerRecord) BackupWhitelist

func (m *MinerRecord) BackupWhitelist(path string) error

func (*MinerRecord) DeleteMinerinfo

func (m *MinerRecord) DeleteMinerinfo(account string)

func (*MinerRecord) GetAllBlacklist

func (m *MinerRecord) GetAllBlacklist() map[string]Reason

func (*MinerRecord) GetAllMinerAccount

func (m *MinerRecord) GetAllMinerAccount() []string

func (*MinerRecord) GetAllMinerinfos

func (m *MinerRecord) GetAllMinerinfos() []Minerinfo

func (*MinerRecord) GetAllWhitelist

func (m *MinerRecord) GetAllWhitelist() []string

func (*MinerRecord) GetAllWhitelistInfos

func (m *MinerRecord) GetAllWhitelistInfos() []Minerinfo

func (*MinerRecord) GetBlacklistInfo

func (m *MinerRecord) GetBlacklistInfo(account string) (Reason, bool)

func (*MinerRecord) GetMinerinfo

func (m *MinerRecord) GetMinerinfo(account string) (Minerinfo, bool)

func (*MinerRecord) HasMinerinfo

func (m *MinerRecord) HasMinerinfo(account string) bool

func (*MinerRecord) IsInBlacklist

func (m *MinerRecord) IsInBlacklist(account string) bool

func (*MinerRecord) LoadBlacklist

func (m *MinerRecord) LoadBlacklist(path string) error

func (*MinerRecord) LoadMinerlist

func (m *MinerRecord) LoadMinerlist(path string) error

func (*MinerRecord) LoadWhitelist

func (m *MinerRecord) LoadWhitelist(path string) error

func (*MinerRecord) RemoveFromBlacklist

func (m *MinerRecord) RemoveFromBlacklist(account string)

func (*MinerRecord) SaveMinerinfo

func (m *MinerRecord) SaveMinerinfo(account string, addr string, state string, idlespace uint64)

type MinerRecorder

type MinerRecorder interface {
	// SaveMinerinfo add or update miner information
	SaveMinerinfo(account string, addr string, state string, idle_space uint64)

	// DeleteMinerinfo delete miner information
	DeleteMinerinfo(account string)

	// HasMinerinfo whether miner information is recorded
	HasMinerinfo(account string) bool

	//
	GetMinerinfo(account string) (Minerinfo, bool)

	//
	GetAllMinerAccount() []string

	//
	GetAllMinerinfos() []Minerinfo

	//
	GetAllWhitelist() []string

	//
	GetAllWhitelistInfos() []Minerinfo

	//
	AddToWhitelist(account string, info Minerinfo)

	//
	AddToBlacklist(account, addr, reason string)

	//
	RemoveFromBlacklist(account string)

	//
	IsInBlacklist(account string) bool

	//
	GetAllBlacklist() map[string]Reason

	//
	GetBlacklistInfo(account string) (Reason, bool)

	//
	BackupMinerlist(path string) error

	//
	LoadMinerlist(path string) error

	//
	BackupBlacklist(path string) error

	//
	LoadBlacklist(path string) error

	//
	BackupWhitelist(path string) error

	//
	LoadWhitelist(path string) error
}

func NewMinerRecord

func NewMinerRecord() MinerRecorder

type Minerinfo

type Minerinfo struct {
	Account   string `json:"account"`
	State     string `json:"state"`
	Addr      string `json:"addr"`
	Idlespace uint64 `json:"idlespace"`
}

type Reason

type Reason struct {
	Account string `json:"account"`
	Reason  string `json:"reason"`
	Addr    string `json:"addr"`
}

Jump to

Keyboard shortcuts

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