notification

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 8 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"
	// 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 *v1alpha1.SNSTopicParameters) *sns.CreateTopicInput

GenerateCreateTopicInput prepares input for CreateTopicRequest

func GenerateSubscribeInput

func GenerateSubscribeInput(p *v1alpha1.SNSSubscriptionParameters) *sns.SubscribeInput

GenerateSubscribeInput prepares input for SubscribeRequest

func GenerateSubscriptionObservation

func GenerateSubscriptionObservation(attr map[string]string) v1alpha1.SNSSubscriptionObservation

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

func GenerateTopicObservation

func GenerateTopicObservation(attr map[string]string) v1alpha1.SNSTopicObservation

GenerateTopicObservation is used to produce SNSTopicObservation from attributes

func GetChangedAttributes

func GetChangedAttributes(p v1alpha1.SNSTopicParameters, attrs map[string]string) map[string]string

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 v1alpha1.SNSSubscriptionParameters, attrs map[string]string) map[string]string

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

func IsSNSSubscriptionAttributesUpToDate

func IsSNSSubscriptionAttributesUpToDate(p v1alpha1.SNSSubscriptionParameters, subAttributes map[string]string) bool

IsSNSSubscriptionAttributesUpToDate checks if attributes are up to date

func IsSNSTopicUpToDate

func IsSNSTopicUpToDate(p v1alpha1.SNSTopicParameters, attr map[string]string) bool

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 *v1alpha1.SNSSubscriptionParameters, subAttributes map[string]string)

LateInitializeSubscription fills the empty fields in *v1alpha1.SNSSubscriptionParameters with the values seen in sns.Subscription

func LateInitializeTopicAttr

func LateInitializeTopicAttr(in *v1alpha1.SNSTopicParameters, attrs map[string]string)

LateInitializeTopicAttr fills the empty fields in *v1alpha1.SNSTopicParameters 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 SNSSubscription

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"
)

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 SNSTopic

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