sns

package
v0.50.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SubscriptionDeliveryPolicy is DeliveryPolicy of SNS Subscription
	SubscriptionDeliveryPolicy = "DeliveryPolicy"
	// SubscriptionFilterPolicy is FilterPolicy of SNS Subscription
	SubscriptionFilterPolicy = "FilterPolicy"
	// SubscriptionFilterPolicyScope is FilterPolicyScope of SNS Subscription
	SubscriptionFilterPolicyScope = "FilterPolicyScope"
	// SubscriptionRawMessageDelivery is RawMessageDelivery of SNS Subscription
	SubscriptionRawMessageDelivery = "RawMessageDelivery"
	// SubscriptionRedrivePolicy is RedrivePolicy of SNS Subscription
	SubscriptionRedrivePolicy = "RedrivePolicy"
	// SubscriptionOwner is Owner of SNS Subscription
	SubscriptionOwner = "Owner"
	// SubscriptionPendingConfirmation is Confirmation Status of SNS Subscription
	SubscriptionPendingConfirmation = "PendingConfirmation"
	// SubscriptionConfirmationWasAuthenticated is Confirmation Authenication Status od SNS Subscription
	SubscriptionConfirmationWasAuthenticated = "ConfirmationWasAuthenticated"
)

Variables

This section is empty.

Functions

func GenerateCreateTopicInput

func GenerateCreateTopicInput(p *v1beta1.TopicParameters) *sns.CreateTopicInput

GenerateCreateTopicInput prepares input for CreateTopicRequest

func GenerateSubscribeInput

func GenerateSubscribeInput(p *v1beta1.SubscriptionParameters) *sns.SubscribeInput

GenerateSubscribeInput prepares input for SubscribeRequest

func GenerateSubscriptionObservation

func GenerateSubscriptionObservation(attr map[string]string) v1beta1.SubscriptionObservation

GenerateSubscriptionObservation is used to produce SubscriptionObservation from resource at cloud & its attributes

func GenerateTopicObservation

func GenerateTopicObservation(attr map[string]string) v1beta1.TopicObservation

GenerateTopicObservation is used to produce TopicObservation from attributes

func GetChangedAttributes

func GetChangedAttributes(p v1beta1.TopicParameters, attrs map[string]string) (map[string]string, error)

GetChangedAttributes will return the changed attributes for a topic in AWS side.

This is needed as currently AWS SDK allows to set Attribute Topics one at a time. Please see https://docs.aws.amazon.com/sns/latest/api/API_SetTopicAttributes.html So we need to compare each topic attribute and call SetTopicAttribute for ones which has changed.

func GetChangedSubAttributes

func GetChangedSubAttributes(p v1beta1.SubscriptionParameters, attrs map[string]string) map[string]string

GetChangedSubAttributes will return the changed attributes for a subscription in provider side

func IsSNSSubscriptionAttributesUpToDate

func IsSNSSubscriptionAttributesUpToDate(p v1beta1.SubscriptionParameters, subAttributes map[string]string) bool

IsSNSSubscriptionAttributesUpToDate checks if attributes are up to date

func IsSNSTopicUpToDate

func IsSNSTopicUpToDate(p v1beta1.TopicParameters, attr map[string]string) (bool, error)

IsSNSTopicUpToDate checks if object is up to date

func IsSubscriptionNotFound

func IsSubscriptionNotFound(err error) bool

IsSubscriptionNotFound returns true if the error code indicates that the item was not found

func IsTopicNotFound

func IsTopicNotFound(err error) bool

IsTopicNotFound returns true if the error code indicates that the item was not found

func LateInitializeSubscription

func LateInitializeSubscription(in *v1beta1.SubscriptionParameters, subAttributes map[string]string)

LateInitializeSubscription fills the empty fields in *v1beta1.SubscriptionParameters with the values seen in sns.Subscription

func LateInitializeTopicAttr

func LateInitializeTopicAttr(in *v1beta1.TopicParameters, attrs map[string]string)

LateInitializeTopicAttr fills the empty fields in *v1beta1.TopicParameters with the values seen in sns.Topic.

Types

type SubscriptionAttributes

type SubscriptionAttributes string

SubscriptionAttributes refers to AWS SNS Subscription Attributes List ref: https://docs.aws.amazon.com/cli/latest/reference/sns/get-subscription-attributes.html#output

type SubscriptionClient

type SubscriptionClient interface {
	Subscribe(ctx context.Context, input *sns.SubscribeInput, opts ...func(*sns.Options)) (*sns.SubscribeOutput, error)
	Unsubscribe(ctx context.Context, input *sns.UnsubscribeInput, opts ...func(*sns.Options)) (*sns.UnsubscribeOutput, error)
	GetSubscriptionAttributes(ctx context.Context, input *sns.GetSubscriptionAttributesInput, opts ...func(*sns.Options)) (*sns.GetSubscriptionAttributesOutput, error)
	SetSubscriptionAttributes(ctx context.Context, input *sns.SetSubscriptionAttributesInput, opts ...func(*sns.Options)) (*sns.SetSubscriptionAttributesOutput, error)
}

SubscriptionClient is the external client used for AWS Subscription

func NewSubscriptionClient

func NewSubscriptionClient(cfg aws.Config) SubscriptionClient

NewSubscriptionClient returns a new client using AWS credentials as JSON encoded data

type TopicAttributes

type TopicAttributes string

TopicAttributes refers to AWS SNS Topic Attributes List ref: https://docs.aws.amazon.com/cli/latest/reference/sns/get-topic-attributes.html#output

const (
	// TopicDisplayName is Display Name of SNS Topic
	TopicDisplayName TopicAttributes = "DisplayName"
	// TopicDeliveryPolicy is Delivery Policy of SNS Topic
	TopicDeliveryPolicy TopicAttributes = "DeliveryPolicy"
	// TopicKmsMasterKeyID is KmsMasterKeyId of SNS Topic
	TopicKmsMasterKeyID TopicAttributes = "KmsMasterKeyId"
	// TopicPolicy is Policy of SNS Topic
	TopicPolicy TopicAttributes = "Policy"
	// TopicOwner is Owner of SNS Topic
	TopicOwner TopicAttributes = "Owner"
	// TopicSubscriptionsConfirmed is status of SNS Topic Subscription Confirmation
	TopicSubscriptionsConfirmed TopicAttributes = "SubscriptionsConfirmed"
	// TopicSubscriptionsPending is status of SNS Topic Subscription Confirmation
	TopicSubscriptionsPending TopicAttributes = "SubscriptionsPending"
	// TopicSubscriptionsDeleted is status of SNS Topic Subscription Confirmation
	TopicSubscriptionsDeleted TopicAttributes = "SubscriptionsDeleted"
	// TopicARN is the ARN for the SNS Topic
	TopicARN TopicAttributes = "TopicArn"
	// TopicFifoTopic is whether or not Topic is fifo
	TopicFifoTopic TopicAttributes = "FifoTopic"
)

type TopicClient

type TopicClient interface {
	CreateTopic(ctx context.Context, input *sns.CreateTopicInput, opts ...func(*sns.Options)) (*sns.CreateTopicOutput, error)
	DeleteTopic(ctx context.Context, input *sns.DeleteTopicInput, opts ...func(*sns.Options)) (*sns.DeleteTopicOutput, error)
	GetTopicAttributes(ctx context.Context, input *sns.GetTopicAttributesInput, opts ...func(*sns.Options)) (*sns.GetTopicAttributesOutput, error)
	SetTopicAttributes(ctx context.Context, input *sns.SetTopicAttributesInput, opts ...func(*sns.Options)) (*sns.SetTopicAttributesOutput, error)
}

TopicClient is the external client used for AWS Topic

func NewTopicClient

func NewTopicClient(cfg aws.Config) TopicClient

NewTopicClient returns a new client using AWS credentials as JSON encoded data.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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