sns

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PublishMessageFormatJSON = "json"
	PublishMessageFormatText = "text"
)

Variables

This section is empty.

Functions

func ListSubscriptions

func ListSubscriptions(ctx core.ListResourcesContext, resourceType string) ([]core.IntegrationResource, error)

func ListTopics

func ListTopics(ctx core.ListResourcesContext, resourceType string) ([]core.IntegrationResource, error)

Types

type Client

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

Client provides lightweight SNS API operations through signed HTTP requests.

func NewClient

func NewClient(httpCtx core.HTTPContext, credentials *aws.Credentials, region string) *Client

NewClient creates a region-scoped SNS client.

func (*Client) CreateTopic

func (c *Client) CreateTopic(name string) (*Topic, error)

func (*Client) DeleteTopic

func (c *Client) DeleteTopic(topicArn string) error

DeleteTopic deletes the topic associated with the provided ARN.

func (*Client) GetSubscription

func (c *Client) GetSubscription(subscriptionArn string) (*Subscription, error)

GetSubscription returns a subscription with normalized attributes.

func (*Client) GetTopic

func (c *Client) GetTopic(topicArn string) (*Topic, error)

GetTopic returns a topic with normalized attributes from GetTopicAttributes.

func (*Client) ListSubscriptionsByTopic

func (c *Client) ListSubscriptionsByTopic(topicArn string) ([]Subscription, error)

func (*Client) ListTopics

func (c *Client) ListTopics() ([]Topic, error)

ListTopics returns all topics in the configured region.

func (*Client) PublishMessage

func (c *Client) PublishMessage(parameters PublishMessageParameters) (*PublishResult, error)

PublishMessage publishes a message to a topic and returns publish metadata.

func (*Client) Subscribe

func (c *Client) Subscribe(parameters SubscribeParameters) (*Subscription, error)

Subscribe creates an SNS subscription and returns the resulting metadata.

func (*Client) Unsubscribe

func (c *Client) Unsubscribe(subscriptionArn string) error

Unsubscribe removes a subscription identified by the provided ARN.

type CreateTopic

type CreateTopic struct{}

func (*CreateTopic) Cancel

func (c *CreateTopic) Cancel(ctx core.ExecutionContext) error

func (*CreateTopic) Cleanup

func (c *CreateTopic) Cleanup(ctx core.SetupContext) error

func (*CreateTopic) Color

func (c *CreateTopic) Color() string

func (*CreateTopic) Configuration

func (c *CreateTopic) Configuration() []configuration.Field

func (*CreateTopic) Description

func (c *CreateTopic) Description() string

func (*CreateTopic) Documentation

func (c *CreateTopic) Documentation() string

func (*CreateTopic) ExampleOutput

func (c *CreateTopic) ExampleOutput() map[string]any

ExampleOutput returns an example payload for CreateTopic.

func (*CreateTopic) Execute

func (c *CreateTopic) Execute(ctx core.ExecutionContext) error

func (*CreateTopic) HandleHook added in v0.18.0

func (c *CreateTopic) HandleHook(ctx core.ActionHookContext) error

func (*CreateTopic) HandleWebhook

func (*CreateTopic) Hooks added in v0.18.0

func (c *CreateTopic) Hooks() []core.Hook

func (*CreateTopic) Icon

func (c *CreateTopic) Icon() string

func (*CreateTopic) Label

func (c *CreateTopic) Label() string

func (*CreateTopic) Name

func (c *CreateTopic) Name() string

func (*CreateTopic) OutputChannels

func (c *CreateTopic) OutputChannels(configuration any) []core.OutputChannel

func (*CreateTopic) ProcessQueueItem

func (c *CreateTopic) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*CreateTopic) Setup

func (c *CreateTopic) Setup(ctx core.SetupContext) error

type CreateTopicConfiguration

type CreateTopicConfiguration struct {
	Region string `json:"region" mapstructure:"region"`
	Name   string `json:"name" mapstructure:"name"`
}

type DeleteTopic

type DeleteTopic struct{}

func (*DeleteTopic) Cancel

func (c *DeleteTopic) Cancel(ctx core.ExecutionContext) error

func (*DeleteTopic) Cleanup

func (c *DeleteTopic) Cleanup(ctx core.SetupContext) error

func (*DeleteTopic) Color

func (c *DeleteTopic) Color() string

func (*DeleteTopic) Configuration

func (c *DeleteTopic) Configuration() []configuration.Field

func (*DeleteTopic) Description

func (c *DeleteTopic) Description() string

func (*DeleteTopic) Documentation

func (c *DeleteTopic) Documentation() string

func (*DeleteTopic) ExampleOutput

func (c *DeleteTopic) ExampleOutput() map[string]any

ExampleOutput returns an example payload for DeleteTopic.

func (*DeleteTopic) Execute

func (c *DeleteTopic) Execute(ctx core.ExecutionContext) error

func (*DeleteTopic) HandleHook added in v0.18.0

func (c *DeleteTopic) HandleHook(ctx core.ActionHookContext) error

func (*DeleteTopic) HandleWebhook

func (*DeleteTopic) Hooks added in v0.18.0

func (c *DeleteTopic) Hooks() []core.Hook

func (*DeleteTopic) Icon

func (c *DeleteTopic) Icon() string

func (*DeleteTopic) Label

func (c *DeleteTopic) Label() string

func (*DeleteTopic) Name

func (c *DeleteTopic) Name() string

func (*DeleteTopic) OutputChannels

func (c *DeleteTopic) OutputChannels(configuration any) []core.OutputChannel

func (*DeleteTopic) ProcessQueueItem

func (c *DeleteTopic) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*DeleteTopic) Setup

func (c *DeleteTopic) Setup(ctx core.SetupContext) error

type DeleteTopicConfiguration

type DeleteTopicConfiguration struct {
	Region   string `json:"region" mapstructure:"region"`
	TopicArn string `json:"topicArn" mapstructure:"topicArn"`
}

type GetSubscription

type GetSubscription struct{}

func (*GetSubscription) Cancel

func (c *GetSubscription) Cancel(ctx core.ExecutionContext) error

func (*GetSubscription) Cleanup

func (c *GetSubscription) Cleanup(ctx core.SetupContext) error

func (*GetSubscription) Color

func (c *GetSubscription) Color() string

func (*GetSubscription) Configuration

func (c *GetSubscription) Configuration() []configuration.Field

func (*GetSubscription) Description

func (c *GetSubscription) Description() string

func (*GetSubscription) Documentation

func (c *GetSubscription) Documentation() string

func (*GetSubscription) ExampleOutput

func (c *GetSubscription) ExampleOutput() map[string]any

ExampleOutput returns an example payload for GetSubscription.

func (*GetSubscription) Execute

func (c *GetSubscription) Execute(ctx core.ExecutionContext) error

func (*GetSubscription) HandleHook added in v0.18.0

func (c *GetSubscription) HandleHook(ctx core.ActionHookContext) error

func (*GetSubscription) HandleWebhook

func (*GetSubscription) Hooks added in v0.18.0

func (c *GetSubscription) Hooks() []core.Hook

func (*GetSubscription) Icon

func (c *GetSubscription) Icon() string

func (*GetSubscription) Label

func (c *GetSubscription) Label() string

func (*GetSubscription) Name

func (c *GetSubscription) Name() string

func (*GetSubscription) OutputChannels

func (c *GetSubscription) OutputChannels(configuration any) []core.OutputChannel

func (*GetSubscription) ProcessQueueItem

func (c *GetSubscription) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*GetSubscription) Setup

func (c *GetSubscription) Setup(ctx core.SetupContext) error

type GetSubscriptionConfiguration

type GetSubscriptionConfiguration struct {
	Region          string `json:"region" mapstructure:"region"`
	TopicArn        string `json:"topicArn" mapstructure:"topicArn"`
	SubscriptionArn string `json:"subscriptionArn" mapstructure:"subscriptionArn"`
}

type GetTopic

type GetTopic struct{}

func (*GetTopic) Cancel

func (c *GetTopic) Cancel(ctx core.ExecutionContext) error

func (*GetTopic) Cleanup

func (c *GetTopic) Cleanup(ctx core.SetupContext) error

func (*GetTopic) Color

func (c *GetTopic) Color() string

func (*GetTopic) Configuration

func (c *GetTopic) Configuration() []configuration.Field

func (*GetTopic) Description

func (c *GetTopic) Description() string

func (*GetTopic) Documentation

func (c *GetTopic) Documentation() string

func (*GetTopic) ExampleOutput

func (c *GetTopic) ExampleOutput() map[string]any

ExampleOutput returns an example payload for GetTopic.

func (*GetTopic) Execute

func (c *GetTopic) Execute(ctx core.ExecutionContext) error

func (*GetTopic) HandleHook added in v0.18.0

func (c *GetTopic) HandleHook(ctx core.ActionHookContext) error

func (*GetTopic) HandleWebhook

func (*GetTopic) Hooks added in v0.18.0

func (c *GetTopic) Hooks() []core.Hook

func (*GetTopic) Icon

func (c *GetTopic) Icon() string

func (*GetTopic) Label

func (c *GetTopic) Label() string

func (*GetTopic) Name

func (c *GetTopic) Name() string

func (*GetTopic) OutputChannels

func (c *GetTopic) OutputChannels(configuration any) []core.OutputChannel

func (*GetTopic) ProcessQueueItem

func (c *GetTopic) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*GetTopic) Setup

func (c *GetTopic) Setup(ctx core.SetupContext) error

type GetTopicConfiguration

type GetTopicConfiguration struct {
	Region   string `json:"region" mapstructure:"region"`
	TopicArn string `json:"topicArn" mapstructure:"topicArn"`
}

type MessageAttribute

type MessageAttribute struct {
	Type  string `json:"Type"`
	Value string `json:"Value"`
}

type OnTopicMessage

type OnTopicMessage struct{}

func (*OnTopicMessage) Cleanup

func (t *OnTopicMessage) Cleanup(ctx core.TriggerContext) error

func (*OnTopicMessage) Color

func (t *OnTopicMessage) Color() string

func (*OnTopicMessage) Configuration

func (t *OnTopicMessage) Configuration() []configuration.Field

func (*OnTopicMessage) Description

func (t *OnTopicMessage) Description() string

func (*OnTopicMessage) Documentation

func (t *OnTopicMessage) Documentation() string

func (*OnTopicMessage) ExampleData

func (t *OnTopicMessage) ExampleData() map[string]any

ExampleData returns an example payload for OnTopicMessage events.

func (*OnTopicMessage) HandleHook added in v0.18.0

func (t *OnTopicMessage) HandleHook(ctx core.TriggerHookContext) (map[string]any, error)

func (*OnTopicMessage) HandleWebhook

func (*OnTopicMessage) Hooks added in v0.18.0

func (t *OnTopicMessage) Hooks() []core.Hook

func (*OnTopicMessage) Icon

func (t *OnTopicMessage) Icon() string

func (*OnTopicMessage) Label

func (t *OnTopicMessage) Label() string

func (*OnTopicMessage) Name

func (t *OnTopicMessage) Name() string

func (*OnTopicMessage) Setup

func (t *OnTopicMessage) Setup(ctx core.TriggerContext) error

type OnTopicMessageConfiguration

type OnTopicMessageConfiguration struct {
	Region   string `json:"region" mapstructure:"region"`
	TopicArn string `json:"topicArn" mapstructure:"topicArn"`
}

type OnTopicMessageMetadata

type OnTopicMessageMetadata struct {
	Region   string `json:"region" mapstructure:"region"`
	TopicArn string `json:"topicArn" mapstructure:"topicArn"`
}

type PublishMessage

type PublishMessage struct{}

func (*PublishMessage) Cancel

func (c *PublishMessage) Cancel(ctx core.ExecutionContext) error

func (*PublishMessage) Cleanup

func (c *PublishMessage) Cleanup(ctx core.SetupContext) error

func (*PublishMessage) Color

func (c *PublishMessage) Color() string

func (*PublishMessage) Configuration

func (c *PublishMessage) Configuration() []configuration.Field

func (*PublishMessage) Description

func (c *PublishMessage) Description() string

func (*PublishMessage) Documentation

func (c *PublishMessage) Documentation() string

func (*PublishMessage) ExampleOutput

func (c *PublishMessage) ExampleOutput() map[string]any

ExampleOutput returns an example payload for PublishMessage.

func (*PublishMessage) Execute

func (c *PublishMessage) Execute(ctx core.ExecutionContext) error

func (*PublishMessage) HandleHook added in v0.18.0

func (c *PublishMessage) HandleHook(ctx core.ActionHookContext) error

func (*PublishMessage) HandleWebhook

func (*PublishMessage) Hooks added in v0.18.0

func (c *PublishMessage) Hooks() []core.Hook

func (*PublishMessage) Icon

func (c *PublishMessage) Icon() string

func (*PublishMessage) Label

func (c *PublishMessage) Label() string

func (*PublishMessage) Name

func (c *PublishMessage) Name() string

func (*PublishMessage) OutputChannels

func (c *PublishMessage) OutputChannels(configuration any) []core.OutputChannel

func (*PublishMessage) ProcessQueueItem

func (c *PublishMessage) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*PublishMessage) Setup

func (c *PublishMessage) Setup(ctx core.SetupContext) error

type PublishMessageConfiguration

type PublishMessageConfiguration struct {
	Region   string  `json:"region" mapstructure:"region"`
	TopicArn string  `json:"topicArn" mapstructure:"topicArn"`
	Format   string  `json:"format" mapstructure:"format"`
	JSON     *any    `json:"json" mapstructure:"json"`
	Text     *string `json:"text" mapstructure:"text"`
}

type PublishMessageParameters

type PublishMessageParameters struct {
	TopicArn          string
	Message           string
	Subject           string
	MessageAttributes map[string]string
}

PublishMessageParameters defines the arguments for a publish operation.

type PublishResult

type PublishResult struct {
	MessageID      string `json:"messageId" mapstructure:"messageId"`
	SequenceNumber string `json:"sequenceNumber,omitempty" mapstructure:"sequenceNumber"`
	TopicArn       string `json:"topicArn" mapstructure:"topicArn"`
}

PublishResult models the response emitted after publishing an SNS message.

type SignableField

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

type SubscribeParameters

type SubscribeParameters struct {
	TopicArn              string
	Protocol              string
	Endpoint              string
	Attributes            map[string]string
	ReturnSubscriptionARN bool
}

SubscribeParameters defines the arguments for a subscribe operation.

type Subscription

type Subscription struct {
	SubscriptionArn     string            `json:"subscriptionArn" mapstructure:"subscriptionArn"`
	TopicArn            string            `json:"topicArn,omitempty" mapstructure:"topicArn"`
	Protocol            string            `json:"protocol,omitempty" mapstructure:"protocol"`
	Endpoint            string            `json:"endpoint,omitempty" mapstructure:"endpoint"`
	Owner               string            `json:"owner,omitempty" mapstructure:"owner"`
	PendingConfirmation bool              `json:"pendingConfirmation" mapstructure:"pendingConfirmation"`
	RawMessageDelivery  bool              `json:"rawMessageDelivery" mapstructure:"rawMessageDelivery"`
	Attributes          map[string]string `json:"attributes,omitempty" mapstructure:"attributes"`
}

Subscription models an AWS SNS subscription payload returned by SNS API operations.

type SubscriptionMessage

type SubscriptionMessage struct {
	Type              string                      `json:"Type"`
	MessageID         string                      `json:"MessageId"`
	TopicArn          string                      `json:"TopicArn"`
	Subject           string                      `json:"Subject"`
	Message           string                      `json:"Message"`
	Timestamp         string                      `json:"Timestamp"`
	SignatureVersion  string                      `json:"SignatureVersion"`
	Signature         string                      `json:"Signature"`
	SigningCertURL    string                      `json:"SigningCertURL"`
	UnsubscribeURL    string                      `json:"UnsubscribeURL"`
	SubscribeURL      string                      `json:"SubscribeURL"`
	Token             string                      `json:"Token"`
	MessageAttributes map[string]MessageAttribute `json:"MessageAttributes"`
}

type Topic

type Topic struct {
	TopicArn                  string            `json:"topicArn" mapstructure:"topicArn"`
	Name                      string            `json:"name" mapstructure:"name"`
	DisplayName               string            `json:"displayName,omitempty" mapstructure:"displayName"`
	Owner                     string            `json:"owner,omitempty" mapstructure:"owner"`
	KmsMasterKeyID            string            `json:"kmsMasterKeyId,omitempty" mapstructure:"kmsMasterKeyId"`
	FifoTopic                 bool              `json:"fifoTopic" mapstructure:"fifoTopic"`
	ContentBasedDeduplication bool              `json:"contentBasedDeduplication" mapstructure:"contentBasedDeduplication"`
	Attributes                map[string]string `json:"attributes,omitempty" mapstructure:"attributes"`
}

Topic models an AWS SNS topic payload returned by SNS API operations.

Jump to

Keyboard shortcuts

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