kelinci

package module
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

README

kelinci

kelinci is a wrapper for rabbitmq that has a function to autoreconnect

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host     string
	Port     string
	UserName string
	Password string
	VHost    string
}

func (*Config) GetUri

func (c *Config) GetUri() string

type ConfigBuilder

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

ConfigBuilder Builder Object for Config

func NewConfigBuilder

func NewConfigBuilder() *ConfigBuilder

NewConfigBuilder Constructor for ConfigBuilder

func (*ConfigBuilder) Build

func (c *ConfigBuilder) Build() *Config

Build Method which creates Config

func (*ConfigBuilder) SetHost

func (c *ConfigBuilder) SetHost(host string)

SetHost Setter method for the field host of type string in the object ConfigBuilder

func (*ConfigBuilder) SetPassword

func (c *ConfigBuilder) SetPassword(password string)

SetPassword Setter method for the field password of type string in the object ConfigBuilder

func (*ConfigBuilder) SetPort

func (c *ConfigBuilder) SetPort(port string)

SetPort Setter method for the field port of type string in the object ConfigBuilder

func (*ConfigBuilder) SetUserName

func (c *ConfigBuilder) SetUserName(userName string)

SetUserName Setter method for the field userName of type string in the object ConfigBuilder

func (*ConfigBuilder) SetVHost

func (c *ConfigBuilder) SetVHost(vHost string)

SetVHost Setter method for the field vHost of type string in the object ConfigBuilder

type Connection

type Connection struct {
	NotifyConfirm chan amqp091.Confirmation
	NotifyClose   chan *amqp091.Error
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(name string, config Config) *Connection

func (*Connection) Channel

func (c *Connection) Channel() (*amqp091.Channel, error)

func (*Connection) Close

func (c *Connection) Close()

func (*Connection) Connect

func (c *Connection) Connect() error

func (*Connection) GetConnection

func (c *Connection) GetConnection(name string) *Connection

func (*Connection) OnClosedConnection

func (c *Connection) OnClosedConnection() error

func (*Connection) Reconnect

func (c *Connection) Reconnect() error

type Consumer

type Consumer interface {
	StartConsuming(queue string, d func(messages amqp091.Delivery))
	Connection() *Connection
	SetConnection(connection *Connection)
	Queue() string
	SetQueue(queue string)
	Consumer() string
	SetConsumer(consumer string)
	AutoAck() bool
	SetAutoAck(autoAck bool)
	Exclusive() bool
	SetExclusive(exclusive bool)
	NoLocal() bool
	SetNoLocal(noLocal bool)
	NoWait() bool
	SetNoWait(noWait bool)
	Args() amqp091.Table
	SetArgs(args amqp091.Table)
}

func NewConsumer

func NewConsumer(connection *Connection) Consumer

type Exchange

type Exchange interface {
	Declare(name string, kind string) error
	Conn() *Connection
	SetConn(conn *Connection)
	Name() string
	SetName(name string)
	Kind() string
	SetKind(kind string)
	Durable() bool
	SetDurable(durable bool)
	AutoDelete() bool
	SetAutoDelete(autoDelete bool)
	Internal() bool
	SetInternal(internal bool)
	NoWait() bool
	SetNoWait(noWait bool)
	Args() amqp091.Table
	SetArgs(args amqp091.Table)
}

func NewExchange

func NewExchange(conn *Connection) Exchange

func NewExchangeWithName

func NewExchangeWithName(conn *Connection, name string) Exchange

func NewExchangeWithParams

func NewExchangeWithParams(conn *Connection, name string, kind string) Exchange

type Publisher

type Publisher interface {
	Publish(ctx context.Context, exchange string, key string, msg amqp091.Publishing) error
	Connection() *Connection
	SetConnection(connection *Connection)
	Mandatory() bool
	SetMandatory(mandatory bool)
	Immediate() bool
	SetImmediate(immediate bool)
	Message() amqp091.Publishing
	SetMessage(message amqp091.Publishing)
	Exchange() string
	SetExchange(exchange string)
	Key() string
	SetKey(key string)
}

func NewPublisher

func NewPublisher(connection *Connection) Publisher

type Queue

type Queue interface {
	Declare(name string) (amqp091.Queue, error)
	Bind(name string, key string, exchange string) error
	Connection() *Connection
	SetConnection(con *Connection)
	Name() string
	SetName(name string)
	Key() string
	SetKey(key string)
	Exchange() string
	SetExchange(exchange string)
	NoWait() bool
	SetNoWait(noWait bool)
	Args() amqp091.Table
	SetArgs(args amqp091.Table)
	Durable() bool
	SetDurable(durable bool)
	AutoDelete() bool
	SetAutoDelete(autoDelete bool)
	Exclusive() bool
	SetExclusive(exclusive bool)
}

func NewQueue

func NewQueue(connection *Connection) Queue

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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