driver

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package driver defines the interface for notification service implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notification

type Notification interface {
	CreateTopic(ctx context.Context, config TopicConfig) (*TopicInfo, error)
	DeleteTopic(ctx context.Context, id string) error
	GetTopic(ctx context.Context, id string) (*TopicInfo, error)
	ListTopics(ctx context.Context) ([]TopicInfo, error)

	Subscribe(ctx context.Context, config SubscriptionConfig) (*SubscriptionInfo, error)
	Unsubscribe(ctx context.Context, subscriptionID string) error
	ListSubscriptions(ctx context.Context, topicID string) ([]SubscriptionInfo, error)

	Publish(ctx context.Context, input PublishInput) (*PublishOutput, error)
}

Notification is the interface that notification provider implementations must satisfy.

type PublishInput

type PublishInput struct {
	TopicID    string
	Subject    string
	Message    string
	Attributes map[string]string
}

PublishInput configures a message publish operation.

type PublishOutput

type PublishOutput struct {
	MessageID string
}

PublishOutput is the result of publishing a message.

type SubscriptionConfig

type SubscriptionConfig struct {
	TopicID  string
	Protocol string // "email", "sms", "http", "https", "sqs", "lambda"
	Endpoint string
}

SubscriptionConfig describes a subscription to create.

type SubscriptionInfo

type SubscriptionInfo struct {
	ID       string
	TopicID  string
	Protocol string
	Endpoint string
	Status   string // "confirmed", "pending"
}

SubscriptionInfo describes a subscription.

type TopicConfig

type TopicConfig struct {
	Name        string
	DisplayName string
	Tags        map[string]string
}

TopicConfig describes a notification topic to create.

type TopicInfo

type TopicInfo struct {
	ID                string
	Name              string
	ResourceID        string
	DisplayName       string
	SubscriptionCount int
	Tags              map[string]string
}

TopicInfo describes a notification topic.

Jump to

Keyboard shortcuts

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