utils

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyValueBootstrap = "bootstrap"
)

Variables

This section is empty.

Functions

func CommonAddressHexRepair added in v1.2.3

func CommonAddressHexRepair(address *common.Address) string

Types

type CounterID

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

func NewCounterID

func NewCounterID() *CounterID

func (*CounterID) Add added in v1.1.3

func (c *CounterID) Add(v string, delta int64)

func (*CounterID) Clone

func (c *CounterID) Clone() map[string]int64

func (*CounterID) Inc

func (c *CounterID) Inc(v string)

type Iterator

type Iterator struct{ Err error }

Iterator does nothing

func (*Iterator) Error

func (it *Iterator) Error() error

Error returns any errors

func (*Iterator) Key

func (*Iterator) Key() []byte

Key returns nil

func (*Iterator) Next

func (*Iterator) Next() bool

Next returns false

func (*Iterator) Release

func (*Iterator) Release()

Release does nothing

func (*Iterator) Value

func (*Iterator) Value() []byte

Value returns nil

type ListenCloser added in v1.1.3

type ListenCloser interface {
	Listen() error
	Close() error
}

ListenCloser listens for messages until it's asked to close

type ListenCloserFactory added in v1.1.3

type ListenCloserFactory func(*servicesctrl.Control, cfg.Config, int, int) ListenCloser

type NoopBatch

type NoopBatch struct{}

NoopBatch does nothing

func (*NoopBatch) Delete

func (*NoopBatch) Delete([]byte) error

Delete returns nil

func (*NoopBatch) Inner

func (b *NoopBatch) Inner() database.Batch

Inner returns itself

func (*NoopBatch) Put

func (*NoopBatch) Put(_, _ []byte) error

Put returns nil

func (*NoopBatch) Replay

Replay does nothing

func (*NoopBatch) Reset

func (*NoopBatch) Reset()

Reset does nothing

func (*NoopBatch) Size added in v1.3.0

func (b *NoopBatch) Size() int

func (*NoopBatch) ValueSize

func (*NoopBatch) ValueSize() int

ValueSize returns 0

func (*NoopBatch) Write

func (*NoopBatch) Write() error

Write returns nil

type NoopDatabase

type NoopDatabase struct{}

NoopDatabase is a lightning fast key value store with probabilistic operations.

func (*NoopDatabase) Close

func (*NoopDatabase) Close() error

Close returns nil

func (*NoopDatabase) Compact

func (*NoopDatabase) Compact(_, _ []byte) error

Compact returns nil

func (*NoopDatabase) Delete

func (*NoopDatabase) Delete([]byte) error

Delete returns nil

func (*NoopDatabase) Get

func (*NoopDatabase) Get([]byte) ([]byte, error)

Get returns nil, error

func (*NoopDatabase) Has

func (*NoopDatabase) Has([]byte) (bool, error)

Has returns false, nil

func (*NoopDatabase) NewBatch

func (*NoopDatabase) NewBatch() database.Batch

NewBatch returns a new batch

func (*NoopDatabase) NewIterator

func (*NoopDatabase) NewIterator() database.Iterator

NewIterator returns a new empty iterator

func (*NoopDatabase) NewIteratorWithPrefix

func (*NoopDatabase) NewIteratorWithPrefix([]byte) database.Iterator

NewIteratorWithPrefix returns a new empty iterator

func (*NoopDatabase) NewIteratorWithStart

func (*NoopDatabase) NewIteratorWithStart([]byte) database.Iterator

NewIteratorWithStart returns a new empty iterator

func (*NoopDatabase) NewIteratorWithStartAndPrefix

func (db *NoopDatabase) NewIteratorWithStartAndPrefix(start, prefix []byte) database.Iterator

NewIteratorWithStartAndPrefix returns a new empty iterator

func (*NoopDatabase) Put

func (*NoopDatabase) Put(_, _ []byte) error

Put returns nil

func (*NoopDatabase) Stat

func (*NoopDatabase) Stat(string) (string, error)

Stat returns an error

type NoopManager added in v1.4.5

type NoopManager struct {
	Databases []*manager.VersionedDatabase
}

func NewNoopManager added in v1.4.5

func NewNoopManager(db database.Database) *NoopManager

func (*NoopManager) Close added in v1.4.5

func (n *NoopManager) Close() error

func (*NoopManager) Current added in v1.4.5

func (n *NoopManager) Current() *manager.VersionedDatabase

func (*NoopManager) GetDatabases added in v1.4.5

func (n *NoopManager) GetDatabases() []*manager.VersionedDatabase

func (*NoopManager) NewCompleteMeterDBManager added in v1.4.5

func (n *NoopManager) NewCompleteMeterDBManager(namespace string, registerer prometheus.Registerer) (manager.Manager, error)

func (*NoopManager) NewMeterDBManager added in v1.4.5

func (n *NoopManager) NewMeterDBManager(namespace string, registerer prometheus.Registerer) (manager.Manager, error)

func (*NoopManager) NewNestedPrefixDBManager added in v1.4.5

func (n *NoopManager) NewNestedPrefixDBManager(prefix []byte) manager.Manager

func (*NoopManager) NewPrefixDBManager added in v1.4.5

func (n *NoopManager) NewPrefixDBManager(prefix []byte) manager.Manager

func (*NoopManager) Previous added in v1.4.5

func (n *NoopManager) Previous() (*manager.VersionedDatabase, bool)

type RetrySleeper added in v1.3.2

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

func NewRetrySleeper added in v1.3.2

func NewRetrySleeper(retries uint64, sleepDuration time.Duration, sleepDurationMax time.Duration) *RetrySleeper

func (*RetrySleeper) Inc added in v1.3.2

func (r *RetrySleeper) Inc()

type Running added in v1.3.2

type Running interface {
	Close()
	IsStopped() bool
}

func NewRunning added in v1.3.2

func NewRunning() Running

type UniqueID

type UniqueID interface {
	Get(id string) (bool, error)
	Put(id string) error
}

func NewMemoryUniqueID

func NewMemoryUniqueID() UniqueID

type Vers added in v1.4.5

type Vers struct {
}

func (*Vers) Compare added in v1.4.5

func (*Vers) Compare(v version.Version) int

func (*Vers) Major added in v1.4.5

func (*Vers) Major() int

func (*Vers) Minor added in v1.4.5

func (*Vers) Minor() int

func (*Vers) Patch added in v1.4.5

func (*Vers) Patch() int

func (*Vers) String added in v1.4.5

func (*Vers) String() string

type Worker

type Worker interface {
	Enque(job interface{})
	Finish(sleepTime time.Duration)
	JobCnt() int64
	IsFinished() bool
}

func NewWorker

func NewWorker(queueSize int, queueCnt int, processor func(int, interface{})) Worker

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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