utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDeadlineExceeded = errors.New("deadline exceeded")
)

Functions

func AwaitConnection

func AwaitConnection(dialer func() (interface{}, error), timeout time.Duration) (interface{}, error)

func DeclareQueue

func DeclareQueue(conn *amqp.Connection, queueName string) error

func MakeRabbitChannel

func MakeRabbitChannel(config rabbit.RabbitConfig, port string) (*amqp.Channel, error)

func PublishMessage

func PublishMessage(body []byte, c *amqp.Channel, queue string, assert *assert.Assertions) bool

func WaitRabbit

func WaitRabbit(rabbitCfg rabbit.RabbitConfig, port string, timeout time.Duration) (*amqp.Connection, error)

Types

type TimeoutRetryer

type TimeoutRetryer struct {
	DeadlineTimeout     time.Duration
	AttemptTimeout      time.Duration
	AttemptErrorHanlder func(err error)
	// contains filtered or unexported fields
}

func NewRetryer

func NewRetryer(f func() (interface{}, error), deadlineTimeout time.Duration) *TimeoutRetryer

func (*TimeoutRetryer) Do

func (r *TimeoutRetryer) Do() (interface{}, error)

Jump to

Keyboard shortcuts

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