rmqconn: github.com/sbabiv/rmqconn Index | Files

package rmqconn

import "github.com/sbabiv/rmqconn"

Index

Package Files

connector.go types.go

Variables

var (
    // ErrConnectionUnavailable remote server is unavailable or network is down
    ErrConnectionUnavailable = errors.New("connection unavailable")
    // ErrClsoe connection was closed earlier
    ErrClose = errors.New("connection was closed earlier")
)

type Conn Uses

type Conn struct {
    sync.Mutex
    // contains filtered or unexported fields
}

Conn connect instance

func (*Conn) Close Uses

func (conn *Conn) Close() error

Close re-conn attempts

func (*Conn) GetChannel Uses

func (conn *Conn) GetChannel() (*amqp.Channel, error)

func (*Conn) IsConnected Uses

func (conn *Conn) IsConnected() bool

IsConnected return connection status

type Connecter Uses

type Connecter interface {
    GetChannel() (*amqp.Channel, error)
    IsConnected() bool
    Close() error
}

Connecter interface for connection instance

func Open Uses

func Open(url string, dial func(string) (Conner, error)) (Connecter, error)

Creates connection and trying to connect use Close method to stop connection attempts

type Conner Uses

type Conner interface {
    Close() error
    NotifyClose(c chan *amqp.Error) chan *amqp.Error
    GetChannel() (*amqp.Channel, error)
}

Conner interface for wrapper Connection

func Dial Uses

func Dial(url string) (Conner, error)

Dial function wrapper amqp.Dial For use amqp.DialConfig or amqp.DialTLS implement your func

Package rmqconn imports 5 packages (graph). Updated 2020-02-27. Refresh now. Tools for package owners.