faketime

package
v0.0.0-...-6a88ae7 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Overview

Package faketime provides a fake clock that implements tcpip.Clock interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ManualClock

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

ManualClock implements tcpip.Clock and only advances manually with Advance method.

func NewManualClock

func NewManualClock() *ManualClock

NewManualClock creates a new ManualClock instance.

func (*ManualClock) Advance

func (mc *ManualClock) Advance(d time.Duration)

Advance executes all work that have been scheduled to execute within d from the current time. Blocks until all work has completed execution.

func (*ManualClock) AfterFunc

func (mc *ManualClock) AfterFunc(d time.Duration, f func()) tcpip.Timer

AfterFunc implements tcpip.Clock.AfterFunc.

func (*ManualClock) NowMonotonic

func (mc *ManualClock) NowMonotonic() int64

NowMonotonic implements tcpip.Clock.NowMonotonic.

func (*ManualClock) NowNanoseconds

func (mc *ManualClock) NowNanoseconds() int64

NowNanoseconds implements tcpip.Clock.NowNanoseconds.

type NullClock

type NullClock struct{}

NullClock implements a clock that never advances.

func (*NullClock) AfterFunc

func (*NullClock) AfterFunc(time.Duration, func()) tcpip.Timer

AfterFunc implements tcpip.Clock.AfterFunc.

func (*NullClock) NowMonotonic

func (*NullClock) NowMonotonic() int64

NowMonotonic implements tcpip.Clock.NowMonotonic.

func (*NullClock) NowNanoseconds

func (*NullClock) NowNanoseconds() int64

NowNanoseconds implements tcpip.Clock.NowNanoseconds.

Jump to

Keyboard shortcuts

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