pika

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToTopic

func AppendToTopic(key, str string) string

Types

type Consumer

type Consumer interface {
	Options() ConsumerOptions
	HandleMessage([]byte) error
}

type ConsumerOptions

type ConsumerOptions struct {
	Exchange  string
	Topic     string
	QueueName string
}

type NotificationOptions

type NotificationOptions struct {
	Exchange string
	Topic    string
	Interval time.Duration
}

type Notifier

type Notifier interface {
	Options() NotificationOptions
	Stop() bool
	Notify() (string, error)
}

type Publisher

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

func (Publisher) Publish

func (p Publisher) Publish(message string) error

type PublisherOptions

type PublisherOptions struct {
	Exchange string
	Topic    string
}

type Queue

type Queue[T any] struct {
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue[T any]() *Queue[T]

func (*Queue[T]) Dequeue

func (q *Queue[T]) Dequeue() (*T, error)

func (*Queue[T]) Length

func (q *Queue[T]) Length() int

func (*Queue[T]) PeakAt

func (q *Queue[T]) PeakAt(i int) (*T, error)

func (*Queue[T]) Peek

func (q *Queue[T]) Peek() (*T, error)

func (*Queue[T]) Queue

func (q *Queue[T]) Queue(e *T)

type RabbitConnector

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

func NewConnector

func NewConnector(url string) (*RabbitConnector, error)

func (RabbitConnector) Channel

func (rc RabbitConnector) Channel() (*amqp.Channel, error)

func (*RabbitConnector) Connect

func (rc *RabbitConnector) Connect(url string) error

func (*RabbitConnector) CreatePublisher

func (r *RabbitConnector) CreatePublisher(options PublisherOptions) (*Publisher, error)

func (RabbitConnector) Disconnect

func (rc RabbitConnector) Disconnect() error

func (*RabbitConnector) StartConsumer

func (r *RabbitConnector) StartConsumer(consumer Consumer) error

func (*RabbitConnector) StartNotifier

func (r *RabbitConnector) StartNotifier(notifier Notifier) error

Jump to

Keyboard shortcuts

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