lib

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MsgContentType = "text/plain"

Variables

View Source
var ConfigFilePath string

Functions

func ReadConfig

func ReadConfig()

Types

type Config

type Config struct {
	Smtp struct {
		Host     string
		Port     int
		User     string
		Password string
	}
	RabbitMQ struct {
		Host         string
		User         string
		Password     string
		QueueName    string `yaml:"queue_name"`
		ExchangeName string `yaml:"exchange_name"`
		ExchangeKind string `yaml:"exchange_kind"`
		Declare      bool
	}
}
var Conf *Config

type Email

type Email struct {
	To          []string
	Subject     string
	Body        string
	ContentType string `json:"content_type"`
}

func (*Email) Send

func (m *Email) Send() error

type RabbitMQ

type RabbitMQ struct {
	Host         string
	QueueName    string
	ExchangeName string
	ExchangeKind string
	Declare      bool
	Connection   *amqp.Connection
	Channel      *amqp.Channel
}

func NewRabbitMQ

func NewRabbitMQ(host string, user string, password string, queueName string, exchangeName string, exchangeKind string, declare bool) (*RabbitMQ, error)

func (*RabbitMQ) Send

func (rmq *RabbitMQ) Send(msg []byte) error

func (*RabbitMQ) StartConsumer

func (rmq *RabbitMQ) StartConsumer() error

Jump to

Keyboard shortcuts

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