events

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	ID         int
	Payload    any
	Headers    map[string]any
	Status     int
	ModelID    int
	RoutingKey string
	Exchange   string
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

func NewEvent

func NewEvent(payload any, headers map[string]any, modelID int, routingKey, exchange string) *Event

func (*Event) GetBody

func (e *Event) GetBody() ([]byte, error)

func (*Event) GetDeliveryMode

func (e *Event) GetDeliveryMode() queue.DeliveryMode

func (*Event) GetHeaders

func (e *Event) GetHeaders() amqp.Table

func (*Event) GetRoutingKey

func (e *Event) GetRoutingKey() string

func (*Event) Sent

func (e *Event) Sent()

func (*Event) SetHeaders

func (e *Event) SetHeaders(headers map[string]any)

type EventBus

type EventBus struct {
	// contains filtered or unexported fields
}

func NewEventBus

func NewEventBus(client *queue.RabbitMQ, repository Repository) *EventBus

func (*EventBus) Send

func (e *EventBus) Send(ctx context.Context, event *Event) error

type EventData

type EventData interface {
	GetModelID() int
	GetID() string
}

type Repository

type Repository interface {
	Create(ctx context.Context, entity *Event) error
	Update(ctx context.Context, entity *Event) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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