Examples Package

Example handlers and utility functions

examples

1
import "gitlab.com/digitalxero/mqutils/examples"

Index

func ManualAckHandler

1
func ManualAckHandler(ctx context.Context, message types.Message)

Example of a handler that uses manual acknowledgment (original pattern)

func ProcessOrderHandler

1
func ProcessOrderHandler(ctx context.Context, message types.Message)

ProcessOrderHandler demonstrates robust message processing with proper acknowledgment handling

func SimpleLogHandler

1
func SimpleLogHandler(ctx context.Context, message types.Message)

Example of a simpler handler that uses the basic acknowledgment without retries

type OrderMessage

OrderMessage represents a sample message structure

1
2
3
4
5
type OrderMessage struct {
    OrderID    string  `json:"order_id"`
    CustomerID string  `json:"customer_id"`
    Amount     float64 `json:"amount"`
}

Generated by gomarkdoc