Documentation ¶
Index ¶
- Constants
- func GenerateCreateTopicInput(p *v1beta1.TopicParameters) *sns.CreateTopicInput
- func GenerateSubscribeInput(p *v1beta1.SubscriptionParameters) *sns.SubscribeInput
- func GenerateSubscriptionObservation(attr map[string]string) v1beta1.SubscriptionObservation
- func GenerateTopicObservation(attr map[string]string) v1beta1.TopicObservation
- func GetChangedAttributes(p v1beta1.TopicParameters, attrs map[string]string) map[string]string
- func GetChangedSubAttributes(p v1beta1.SubscriptionParameters, attrs map[string]string) map[string]string
- func IsSNSSubscriptionAttributesUpToDate(p v1beta1.SubscriptionParameters, subAttributes map[string]string) bool
- func IsSNSTopicUpToDate(p v1beta1.TopicParameters, attr map[string]string) bool
- func IsSubscriptionNotFound(err error) bool
- func IsTopicNotFound(err error) bool
- func LateInitializeSubscription(in *v1beta1.SubscriptionParameters, subAttributes map[string]string)
- func LateInitializeTopicAttr(in *v1beta1.TopicParameters, attrs map[string]string)
- type SubscriptionAttributes
- type SubscriptionClient
- type TopicAttributes
- type TopicClient
Constants ¶
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 *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 ¶
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
IsSNSTopicUpToDate checks if object is up to date
func IsSubscriptionNotFound ¶
IsSubscriptionNotFound returns true if the error code indicates that the item was not found
func IsTopicNotFound ¶
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.