connection

package
v0.0.0-...-beb54cf Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Channel

type Channel interface {
	Name() string

	Put(body []byte, pri uint32, delay, ttr time.Duration) (id uint64, err error)
}

type Channels

type Channels interface {
	Reserve(timeout time.Duration) (id uint64, body []byte, err error)
}

type Configuration

type Configuration struct {
	Tubes []string
	Url   string
}

func NewConfiguration

func NewConfiguration() *Configuration

type Connection

type Connection struct {
	consumer.ConnectionHandler

	*Configuration
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(config *Configuration, dialer Dialer) *Connection

func (*Connection) Close

func (c *Connection) Close() error

func (*Connection) Config

func (c *Connection) Config() *Configuration

func (*Connection) DefaultTube

func (c *Connection) DefaultTube() (string, error)

func (*Connection) Delete

func (c *Connection) Delete(id uint64) (err error)

func (*Connection) Dialer

func (c *Connection) Dialer() Dialer

func (*Connection) Init

func (c *Connection) Init() (err error)

func (*Connection) Put

func (c *Connection) Put(body []byte, pri uint32, delay, ttr time.Duration) (id uint64, err error)

func (*Connection) Reserve

func (c *Connection) Reserve(timeout time.Duration) (id uint64, body []byte, err error)

type Dialer

type Dialer interface {
	Dial(addr string, tubes []string) (consumer.ConnectionHandler, error)

	CreateChannels() Channels
	CreateChannel() Channel
}

type Handler

type Handler interface {
	Init() error
	Close() error

	Config() *Configuration

	Dialer() Dialer
}

Jump to

Keyboard shortcuts

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