internal

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package internal contains code that we don't want to export outside of job-manager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureTimeProvider

func EnsureTimeProvider(ctx context.Context) context.Context

func IgnoreError

func IgnoreError(err error)

func NewTicker

func NewTicker(d time.Duration) *defaultTicker

func SetMockTime

func SetMockTime(ctx context.Context, nows ...time.Time) context.Context

func SetTicker

func SetTicker(ctx context.Context, tick Ticker) context.Context

func SetTimeProvider

func SetTimeProvider(ctx context.Context, t TimeProvider) context.Context

func Sleep

func Sleep(ctx context.Context, d time.Duration) error

Types

type MockTick

type MockTick struct {
	C chan time.Time
	// contains filtered or unexported fields
}

func NewMockTick

func NewMockTick(d time.Duration) *MockTick

func (*MockTick) Chan

func (t *MockTick) Chan() <-chan time.Time

func (*MockTick) SetNow

func (t *MockTick) SetNow(nows ...time.Time)

func (*MockTick) Stop

func (t *MockTick) Stop()

func (*MockTick) Tick

func (t *MockTick) Tick()

type MockTime

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

func (*MockTime) Now

func (t *MockTime) Now() time.Time

func (*MockTime) SetNow

func (t *MockTime) SetNow(nows ...time.Time)

type Ticker

type Ticker interface {
	Chan() <-chan time.Time
	Stop()
}

func GetTicker

func GetTicker(ctx context.Context) Ticker

type Time

type Time int

func (Time) Now

func (t Time) Now() time.Time

type TimeProvider

type TimeProvider interface {
	Now() time.Time
}

func GetTimeProvider

func GetTimeProvider(ctx context.Context) TimeProvider

Jump to

Keyboard shortcuts

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