testing

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeMessage

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

FakeMessage implements Message interface.

func NewFakeMessage

func NewFakeMessage(data []byte, acked, nacked bool) *FakeMessage

NewFakeMessage creates a new FakeMessage object.

func (*FakeMessage) Ack

func (m *FakeMessage) Ack()

Ack changes the mssage state to 'Acked'.

func (*FakeMessage) Acked

func (m *FakeMessage) Acked() bool

Acked returned true if the message has been acked.

func (*FakeMessage) Data

func (m *FakeMessage) Data() []byte

Data returns the message'm payload.

func (*FakeMessage) Metadata

func (m *FakeMessage) Metadata() map[string]string

Metadata returns the message'm payload.

func (*FakeMessage) Nack

func (m *FakeMessage) Nack()

Nack changes the mssage state to 'Nacked'.

func (*FakeMessage) Nacked

func (m *FakeMessage) Nacked() bool

Nacked returned true if the message has been nacked.

type FakeSubscriber

type FakeSubscriber struct {
	Close func()
	// contains filtered or unexported fields
}

FakeSubscriber implements Subscriber interface for testing.

func NewFakeSubscriber

func NewFakeSubscriber() *FakeSubscriber

NewFakeSubscriber creates a new FakeSubscriber instance.

func (*FakeSubscriber) AddMessage

func (s *FakeSubscriber) AddMessage(m subee.Message)

AddMessage simulates receiving a new message.

func (*FakeSubscriber) CloseWithError

func (s *FakeSubscriber) CloseWithError(err error)

CloseWithError closes Subscriber with an error.

func (*FakeSubscriber) Subscribe

func (s *FakeSubscriber) Subscribe(ctx context.Context, f func(subee.Message)) error

Subscribe implements Subscriber.Subscribe.

Jump to

Keyboard shortcuts

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