utils

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadPostgres

func LoadPostgres(database config.Database, node core.Node) postgres.DB

func RollbackAndLogFailure added in v0.0.10

func RollbackAndLogFailure(tx *sqlx.Tx, txErr error, fieldName string)

Types

type Callback added in v0.1.1

type Callback func() error

type CallbackWithArg added in v0.1.1

type CallbackWithArg func(header core.Header) error

type StandardTimer added in v0.1.1

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

func (StandardTimer) ElapsedTime added in v0.1.1

func (timer StandardTimer) ElapsedTime() time.Duration

func (*StandardTimer) Start added in v0.1.1

func (timer *StandardTimer) Start()

func (StandardTimer) WaitFor added in v0.1.1

func (timer StandardTimer) WaitFor(sleepTime time.Duration)

type Throttler added in v0.1.1

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

func NewThrottler added in v0.1.1

func NewThrottler(timer Timer) Throttler

func (Throttler) Throttle added in v0.1.1

func (throttler Throttler) Throttle(minTime time.Duration, f Callback) error

type ThrottlerFunc added in v0.1.1

type ThrottlerFunc func(time.Duration, Callback) error

type ThrottlerFuncWithArg added in v0.1.1

type ThrottlerFuncWithArg func(time.Duration, CallbackWithArg, core.Header) error

type ThrottlerWithArgs added in v0.1.1

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

func NewThrottlerWithArgs added in v0.1.1

func NewThrottlerWithArgs(timer Timer) ThrottlerWithArgs

func (ThrottlerWithArgs) Throttle added in v0.1.1

func (throttler ThrottlerWithArgs) Throttle(minTime time.Duration, f CallbackWithArg, header core.Header) error

type Timer added in v0.1.1

type Timer interface {
	WaitFor(sleep time.Duration)
	ElapsedTime() time.Duration
	Start()
}

Jump to

Keyboard shortcuts

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