wallclock

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 2 Imported by: 0

README

wallclock

import "github.com/Azure/iot-operations-sdks/go/protocol/wallclock"

Index

type Timer

Timer abstracts the functionality of time.Timer.

type Timer interface {
    C() <-chan time.Time
    Reset(d time.Duration) bool
    Stop() bool
}

type WallClock

WallClock abstracts a subset of functionality from packages context and time.

type WallClock interface {
    WithTimeoutCause(
        parent context.Context,
        timeout time.Duration,
        cause error,
    ) (context.Context, context.CancelFunc)
    After(d time.Duration) <-chan time.Time
    NewTimer(d time.Duration) Timer
    Now() time.Time
}

Instance is a WallClock singleton used for indirect time-based references to packages context and time. Test code can set the instance to interpose on functions and control apparent time.

var Instance WallClock = wallClock{}

Generated by gomarkdoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Timer

type Timer interface {
	C() <-chan time.Time
	Reset(d time.Duration) bool
	Stop() bool
}

Timer abstracts the functionality of time.Timer.

type WallClock

type WallClock interface {
	WithTimeoutCause(
		parent context.Context,
		timeout time.Duration,
		cause error,
	) (context.Context, context.CancelFunc)
	After(d time.Duration) <-chan time.Time
	NewTimer(d time.Duration) Timer
	Now() time.Time
}

WallClock abstracts a subset of functionality from packages context and time.

var Instance WallClock = wallClock{}

Instance is a WallClock singleton used for indirect time-based references to packages context and time. Test code can set the instance to interpose on functions and control apparent time.

Jump to

Keyboard shortcuts

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