broker

package
v0.0.0-...-794b143 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	Logger *logrus.Logger
	// contains filtered or unexported fields
}

func New

func New(config *BrokerConfig) *Broker

func (*Broker) Close

func (b *Broker) Close()

func (*Broker) FromGOB64

func (b *Broker) FromGOB64(str string) (*tgbotapi.Message, error)

func (*Broker) Open

func (b *Broker) Open(queueName string) error

func (*Broker) Recieve

func (b *Broker) Recieve() (<-chan amqp.Delivery, error)

func (*Broker) Send

func (b *Broker) Send(m tgbotapi.Message) error

type BrokerConfig

type BrokerConfig struct {
	Login    string `toml:"login"`
	Pass     string `toml:"pass"`
	Post     string `toml:"host"`
	Port     int    `toml:"port"`
	LogLevel string `toml:"log_level"`
	Debug    bool   `toml:"debug"`
	URL      string
}

func NewConfig

func NewConfig() *BrokerConfig

func ReadConfig

func ReadConfig(path string) *BrokerConfig

func (*BrokerConfig) BuildAmqpURL

func (c *BrokerConfig) BuildAmqpURL()

Jump to

Keyboard shortcuts

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