testutils

package
v0.0.0-...-b270c2c Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package testutils contains helper code for testing startstopper.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockMap

type MockMap struct {
	mock.Mock
	sync.RWMutex
}

MockMap is a mocked Map.

func (*MockMap) AddAndStart

func (m *MockMap) AddAndStart(ctx context.Context, key string, ss startstopper.StartStopper) (bool, error)

AddAndStart implements interface.

func (*MockMap) DeleteAndStop

func (m *MockMap) DeleteAndStop(ctx context.Context, key string) (bool, error)

DeleteAndStop implements interface.

func (*MockMap) ForEach

func (m *MockMap) ForEach(f func(key string, ss startstopper.StartStopper))

ForEach implements interface.

func (*MockMap) Get

func (m *MockMap) Get(key string) (startstopper.StartStopper, bool)

Get implements interface.

func (*MockMap) Len

func (m *MockMap) Len() int

Len implements interface.

func (*MockMap) UpdateAndRestart

func (m *MockMap) UpdateAndRestart(ctx context.Context, key string, ss startstopper.StartStopper) (bool, error)

UpdateAndRestart implements interface.

type MockRunner

type MockRunner struct {
	mock.Mock
}

MockRunner is a mocked Runner.

func (*MockRunner) Run

func (m *MockRunner) Run(ctx context.Context, stopChan <-chan struct{}) error

Run implements interface.

type MockStartStopper

type MockStartStopper struct {
	mock.Mock
}

MockStartStopper is a mocked StartStopper.

func (*MockStartStopper) Done

func (m *MockStartStopper) Done() <-chan struct{}

Done implements interface.

func (*MockStartStopper) Err

func (m *MockStartStopper) Err(ctx context.Context) error

Err implements interface.

func (*MockStartStopper) Start

func (m *MockStartStopper) Start(ctx context.Context) error

Start implements interface.

func (*MockStartStopper) Stop

func (m *MockStartStopper) Stop(ctx context.Context) error

Stop implements interface.

Jump to

Keyboard shortcuts

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