interfaces

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package interfaces contains interfaces for wpool package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Errorf(error, string, ...interface{})
	Infof(string, ...interface{})
}

Logger is a logger interface.

type MockLogger

type MockLogger struct {
	mock.Mock
}

MockLogger is an autogenerated mock type for the Logger type

func NewMockLogger

func NewMockLogger(t testing.TB) *MockLogger

NewMockLogger creates a new instance of MockLogger. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockLogger) Errorf

func (_m *MockLogger) Errorf(_a0 error, _a1 string, _a2 ...interface{})

Errorf provides a mock function with given fields: _a0, _a1, _a2

func (*MockLogger) Infof

func (_m *MockLogger) Infof(_a0 string, _a1 ...interface{})

Infof provides a mock function with given fields: _a0, _a1

type MockPool

type MockPool struct {
	mock.Mock
}

MockPool is an autogenerated mock type for the Pool type

func NewMockPool

func NewMockPool(t testing.TB) *MockPool

NewMockPool creates a new instance of MockPool. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockPool) AddTask

func (_m *MockPool) AddTask(_a0 Task) error

AddTask provides a mock function with given fields: _a0

func (*MockPool) AddWorker

func (_m *MockPool) AddWorker(_a0 Worker) error

AddWorker provides a mock function with given fields: _a0

func (*MockPool) Close

func (_m *MockPool) Close() error

Close provides a mock function with given fields:

type MockTask

type MockTask struct {
	mock.Mock
}

MockTask is an autogenerated mock type for the Task type

func NewMockTask

func NewMockTask(t testing.TB) *MockTask

NewMockTask creates a new instance of MockTask. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockTask) Do

func (_m *MockTask) Do()

Do provides a mock function with given fields:

func (*MockTask) GetID

func (_m *MockTask) GetID() string

GetID provides a mock function with given fields:

type MockWorker

type MockWorker struct {
	mock.Mock
}

MockWorker is an autogenerated mock type for the Worker type

func NewMockWorker

func NewMockWorker(t testing.TB) *MockWorker

NewMockWorker creates a new instance of MockWorker. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockWorker) Close

func (_m *MockWorker) Close() error

Close provides a mock function with given fields:

func (*MockWorker) Do

func (_m *MockWorker) Do(_a0 Task) error

Do provides a mock function with given fields: _a0

type Pool

type Pool interface {
	io.Closer
	AddWorker(Worker) error
	AddTask(Task) error
}

Pool is a pool interface.

type Task

type Task interface {
	GetID() string
	Do()
}

Task is a task interface.

type Worker

type Worker interface {
	io.Closer
	Do(Task) error
}

Worker is a worker interface.

Jump to

Keyboard shortcuts

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