pubsub

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminNotification

type AdminNotification struct {
	To         string
	Subject    string
	Body       string
	SmsMessage string
	Priority   string // "high", "medium", "low"
}

AdminNotification represents an administrative notification

type Config

type Config struct {
	// Application name for notifications and messages
	ApplicationName string

	// Notification settings
	NotificationSubject   string
	NotificationSmsPrefix string

	// Logger configuration
	LogLevel string
}

Config contains configuration for PubSub system This allows the library to be used in different projects

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns default configuration for FreiCON project

func NewConfig

func NewConfig(appName string) Config

NewConfig creates a new configuration with custom application name

type CreateSubscriptionRequest

type CreateSubscriptionRequest struct {
	SubscriberID int64  `json:"clientID"`
	CbuID        int64  `json:"cbuId"`
	TopicCode    string `json:"class"`
	Identifier   string `json:"identifier"`
	CallbackUrl  string `json:"callbackURL"`
	TrackID      int64  `json:"trackId"`
}

func (CreateSubscriptionRequest) Validate

func (m CreateSubscriptionRequest) Validate() error

type CreateSubscriptionResponse

type CreateSubscriptionResponse struct {
	ErrorCode    string `json:"errorCode"`
	ErrorMessage string `json:"errorMessage"`
}

type DeleteSubscriptionRequest

type DeleteSubscriptionRequest struct {
	ClientID int64 `json:"clientID"`
	TrackID  int64 `json:"trackId"`
}

func (DeleteSubscriptionRequest) Validate

func (m DeleteSubscriptionRequest) Validate() error

type DeleteSubscriptionResponse

type DeleteSubscriptionResponse struct {
	model.Subscription
}

type Filter

type Filter struct {
	SubscriberID int
	CbuID        int
	TopicID      string
	IsActive     bool
}

type ListSubscriptionsResponse

type ListSubscriptionsResponse struct {
	Items []model.Subscription `json:"items"`
}

type NoopNotificationSender

type NoopNotificationSender struct{}

NoopNotificationSender is a no-op implementation for testing

func (*NoopNotificationSender) SendAdminNotification

func (n *NoopNotificationSender) SendAdminNotification(ctx context.Context, notification AdminNotification) error

type NotificationSender

type NotificationSender interface {
	// SendAdminNotification sends a notification to administrators
	SendAdminNotification(ctx context.Context, notification AdminNotification) error
}

NotificationSender defines interface for sending notifications This allows different implementations (email, SMS, etc.) to be plugged in

type PublishMessage

type PublishMessage struct {
	model.DataMessage
}

type SubscriptionResponse

type SubscriptionResponse struct {
	model.Subscription
}

Jump to

Keyboard shortcuts

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