utils

package
v0.0.0-...-1f8a15b Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HexEncodePublicKey

func HexEncodePublicKey(key *ecdsa.PublicKey) string

func HexEncodePublicKeys

func HexEncodePublicKeys(keys []*ecdsa.PublicKey) []string

func ParseHexPublicKey

func ParseHexPublicKey(keyStr string) (*ecdsa.PublicKey, error)

func ParseHexPublicKeys

func ParseHexPublicKeys(hexKeys []string) ([]*ecdsa.PublicKey, error)

func Retry

func Retry(
	ctx context.Context,
	retryCount int,
	delayForAttempt func(attempt int) time.Duration,
	isRecoverableError func(error) bool,
	logger log.Logger,
	opName string,
	op func(context.Context) (interface{}, error),
) (interface{}, error)

func Sleep

func Sleep(parentContext context.Context, timeout time.Duration)

Types

type TaskQueue

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

func NewTaskQueue

func NewTaskQueue(
	name string,
	capacity uint,
	logFuncProvider func(err error) func(msg string, ctx ...interface{}),
) *TaskQueue

func (*TaskQueue) EnqueueTask

func (queue *TaskQueue) EnqueueTask(ctx context.Context, op func(context.Context) error)

func (*TaskQueue) Run

func (queue *TaskQueue) Run(ctx context.Context)

Jump to

Keyboard shortcuts

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