events

package
v1.35.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricEnqueuedTotal = "enqueued_total"
	MetricSentTotal     = "sent_total"
	MetricFailedTotal   = "failed_total"

	LabelEvent        = "event"
	LabelDeliveryType = "delivery_type"
	LabelReason       = "reason"

	DeliveryTypePush    = "push"
	DeliveryTypeSSE     = "sse"
	DeliveryTypeUnknown = "unknown"

	FailureReasonSerializationError = "serialization_error"
	FailureReasonPublishError       = "publish_error"
	FailureReasonProviderFailed     = "provider_failed"

	EventTypeUnknown = "unknown"
)

Metric constants.

Variables

View Source
var (
	ErrValidationFailed = errors.New("validation failed")
)

Functions

func Module

func Module() fx.Option

Types

type Event

type Event struct {
	EventType smsgateway.PushEventType `json:"event_type"`
	Data      map[string]string        `json:"data"`
}

func NewEvent

func NewEvent(eventType smsgateway.PushEventType, data map[string]string) Event

func NewMessageEnqueuedEvent

func NewMessageEnqueuedEvent() Event

func NewMessagesExportRequestedEvent

func NewMessagesExportRequestedEvent(since, until time.Time) Event

func NewSettingsUpdatedEvent

func NewSettingsUpdatedEvent() Event

func NewWebhooksUpdatedEvent

func NewWebhooksUpdatedEvent() Event

type Service

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

func NewService

func NewService(
	devicesSvc *devices.Service,
	sseSvc *sse.Service,
	pushSvc *push.Service,
	pubsub pubsub.PubSub,
	metrics *metrics,
	logger *zap.Logger,
) *Service

func (*Service) Notify

func (s *Service) Notify(userID string, deviceID *string, event Event) error

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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