groupsync

package
v0.0.0-...-37936d6 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const RabbitExchangeName = ""

Exchange name in RabbitMQ

View Source
const RabbitQueueName = "group_sync"

Queue name in RabbitMQ, used by consumer and producer to exchange message.

Variables

This section is empty.

Functions

func DeclareQueue

func DeclareQueue(ch *amqp.Channel) error

Declare a queue in RabbitMQ named RabbitQueueName.

Types

type Message

type Message struct {
	GroupID  string `json:"group_id"`
	MemberID string `json:"member_id"`
	Trial    int    `json:"trial"`
}

func (*Message) ExceededTrialLimit

func (m *Message) ExceededTrialLimit(limit int) bool

ExceededTrialLimit returns true if Trial is greater than limit, given limit is positive.

func (*Message) Fields

func (m *Message) Fields() map[string]interface{}

Fields returns the structure fields in a map, for easy logging.

func (*Message) Retry

func (m *Message) Retry()

Retry increments Trial by one

Jump to

Keyboard shortcuts

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