client

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockQueue

func NewMockQueue() amqp.Queue

NewMockQueue returns a amqp.Queue

func Run

func Run(p Pitcher, name string, msg string) error

Run start pitcher instance

Types

type MockPitch

type MockPitch struct {
	Connection *amqp.Connection
	Channel    *amqp.Channel
}

MockPitch is the Pitch Mock

func (*MockPitch) Connect

func (mp *MockPitch) Connect() error

Connect mocks connection

func (*MockPitch) CreateChannel

func (mp *MockPitch) CreateChannel() error

CreateChannel create channel from connection

func (*MockPitch) DeclareQueue

func (mp *MockPitch) DeclareQueue(body string) (amqp.Queue, error)

DeclareQueue sends the message to the queue

func (*MockPitch) DestroyChannel

func (mp *MockPitch) DestroyChannel() error

DestroyChannel close open channel

func (*MockPitch) Disconnect

func (mp *MockPitch) Disconnect() error

Disconnect close connection

func (*MockPitch) Publish

func (mp *MockPitch) Publish(qu amqp.Queue, msg string) error

Publish todo doc

type Pitch

type Pitch struct {
	Connection *amqp.Connection
	Channel    *amqp.Channel
}

Pitch todo doc

func (*Pitch) Connect

func (p *Pitch) Connect() error

Connect open new Connection

func (*Pitch) CreateChannel

func (p *Pitch) CreateChannel() error

CreateChannel create channel from connection

func (*Pitch) DeclareQueue

func (p *Pitch) DeclareQueue(body string) (amqp.Queue, error)

DeclareQueue sends the message to the queue

func (*Pitch) DestroyChannel

func (p *Pitch) DestroyChannel() error

DestroyChannel close open channel

func (*Pitch) Disconnect

func (p *Pitch) Disconnect() error

Disconnect close connection

func (*Pitch) Publish

func (p *Pitch) Publish(qu amqp.Queue, msg string) error

Publish todo doc

type Pitcher

type Pitcher interface {
	Connect() error
	Disconnect() error
	CreateChannel() error
	DestroyChannel() error
	DeclareQueue(string) (amqp.Queue, error)
	Publish(amqp.Queue, string) error
}

Pitcher is the Pitch interface

Jump to

Keyboard shortcuts

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