test

package
v3.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogWriter

type LogWriter struct {
	Logs []string
}

LogWriter defines structure for log writer.

func LogSetup

func LogSetup() *LogWriter

LogSetup initializes log writer.

func (*LogWriter) Write

func (sw *LogWriter) Write(p []byte) (n int, err error)

Write writes p bytes to log writer.

type MockTimerClient

type MockTimerClient struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MockTimerClient contains mock timer client.

func (*MockTimerClient) Advance

func (m *MockTimerClient) Advance(d time.Duration)

Advance simulates time passing and signal timers / tickers accordingly

func (*MockTimerClient) After

func (m *MockTimerClient) After(d time.Duration) <-chan time.Time

After is mock of time.After().

func (*MockTimerClient) AfterCalledTimes

func (m *MockTimerClient) AfterCalledTimes() uint64

AfterCalledTimes calculates number of times after is called.

func (*MockTimerClient) Tick

func (m *MockTimerClient) Tick(d time.Duration) <-chan time.Time

Tick is mock of time.Tick().

func (*MockTimerClient) TickCalledTimes

func (m *MockTimerClient) TickCalledTimes() uint64

TickCalledTimes calculates number of times tick is called.

Jump to

Keyboard shortcuts

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