utils

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2020 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const GovNodeCacheTime = time.Minute * 10
View Source
const HostsResolverCacheTime = time.Minute * 10

Variables

This section is empty.

Functions

func GetGovernanceView

func GetGovernanceView(backend *ledger.Ledger) (*governance.GovernanceView, error)

func GetPeersConfig

func GetPeersConfig(backend *ledger.Ledger, view uint32) ([]*config.VBFTPeerStakeInfo, uint32, error)

Types

type GovCache

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

type GovNodeLedgerResolver

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

func NewGovNodeResolver

func NewGovNodeResolver(db *ledger.Ledger) *GovNodeLedgerResolver

func (*GovNodeLedgerResolver) IsGovNode

func (self *GovNodeLedgerResolver) IsGovNode(pubKey string) bool

func (*GovNodeLedgerResolver) IsGovNodePubKey

func (self *GovNodeLedgerResolver) IsGovNodePubKey(key keypair.PublicKey) bool

type GovNodeMockResolver

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

func NewGovNodeMockResolver

func NewGovNodeMockResolver(gov []string) *GovNodeMockResolver

func (*GovNodeMockResolver) IsGovNode

func (self *GovNodeMockResolver) IsGovNode(key string) bool

func (*GovNodeMockResolver) IsGovNodePubKey

func (self *GovNodeMockResolver) IsGovNodePubKey(key keypair.PublicKey) bool

type GovNodeResolver

type GovNodeResolver interface {
	IsGovNodePubKey(key keypair.PublicKey) bool
	IsGovNode(key string) bool
}

type HostsCache

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

type HostsResolver

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

host resolver with cache

func NewHostsResolver

func NewHostsResolver(hosts []string) (*HostsResolver, []string)

func (*HostsResolver) GetHostAddrs

func (self *HostsResolver) GetHostAddrs() []string

type Parker

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

func NewParker

func NewParker() *Parker

func (*Parker) ParkTimeout

func (self *Parker) ParkTimeout(d time.Duration)

func (*Parker) Unpark

func (self *Parker) Unpark()

Jump to

Keyboard shortcuts

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