mock

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2016 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job added in v0.5.1

type Job struct {
	Payload, Name, GearmanHandle, ID string
	GearmanErr                       error
	GearmanWarnings                  [][]byte
	DataBuffer                       bytes.Buffer
	Numerator, Denominator           int
}

Job is a fake Gearman job for tests

func CreateMockJob

func CreateMockJob(payload string) *Job

CreateMockJob creates an object that implements the gearman-go/worker#Job interface

func (Job) Data added in v0.5.1

func (m Job) Data() []byte

Data returns the Gearman payload

func (Job) Err added in v0.5.1

func (m Job) Err() error

Err returns the job's error

func (Job) Fn added in v0.5.1

func (m Job) Fn() string

Fn returns the job's name

func (Job) Handle added in v0.5.1

func (m Job) Handle() string

Handle returns the job's handle

func (Job) OutData added in v0.5.1

func (m Job) OutData() []byte

OutData returns the Gearman outpack data

func (*Job) SendData added in v0.5.1

func (m *Job) SendData(data []byte)

SendData appends to the array of job data

func (*Job) SendWarning added in v0.5.1

func (m *Job) SendWarning(warning []byte)

SendWarning appends to the array of job warnings

func (Job) UniqueId added in v0.5.1

func (m Job) UniqueId() string

UniqueId returns the unique id for the job

func (*Job) UpdateStatus added in v0.5.1

func (m *Job) UpdateStatus(numerator, denominator int)

UpdateStatus updates the progress of job

func (*Job) Warnings added in v0.5.1

func (m *Job) Warnings() [][]byte

Warnings returns the array of jobs warnings

Jump to

Keyboard shortcuts

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