notification

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package notification service communication module. Communication takes place via rabbit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(cfg Config) (*amqp.Connection, error)

Connect creates a connection to rabbit. IMPORTANT: does not declare a queue or anything else, the calling code must do so.

func New

func New(ch channel, opt ...Option) app.Notification

New creates a new instance of the app.NotificationTask object. Accepts the parameter interface type object, which is basically implemented *amqp.Channel. Accepts the interface for convenient testing.

Types

type Config

type Config struct {
	User string
	Pass string
	Host string
	Port int
}

Config for connections rabbit.

type Option

type Option func(*client)

Option for building rabbit client.

func AppID

func AppID(appID string) Option

AppID set options for connect rabbit.

func Exchange

func Exchange(exchange string) Option

Exchange set options for connect rabbit.

func GeneratorID

func GeneratorID(generator func() (string, error)) Option

GeneratorID set options for connect rabbit.

func Immediate

func Immediate() Option

Immediate set options for connect rabbit.

func Mandatory

func Mandatory() Option

Mandatory set options for connect rabbit.

func RoutingKey

func RoutingKey(key string) Option

RoutingKey set options for connect rabbit.

Jump to

Keyboard shortcuts

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