utils

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: BSD-3-Clause Imports: 8 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 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 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 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