queue

package
v0.0.1-alpha1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArnEquals

type ArnEquals struct {
	AwsSourceArn string `json:"aws:SourceArn"`
}

ArnEquals is a mapping for the SourceArn

type Condition

type Condition struct {
	ArnEquals ArnEquals `json:"ArnEquals"`
}

Condition defines the Condition for Statments

type Handler

type Handler interface {
	HandleMessage(config *config.Config, msg *MessageBody) error
}

Handler allows a custom function to be passed

type HandlerFunc

type HandlerFunc func(config *config.Config, msg *MessageBody) error

HandlerFunc allows you to define a custom function for when a message is stored

func (HandlerFunc) HandleMessage

func (f HandlerFunc) HandleMessage(config *config.Config, msg *MessageBody) error

HandleMessage will stub the handler for processing messages

type MessageBody

type MessageBody struct {
	Type               string `json:"Type"`
	TopicArn           string `json:"TopicArn"`
	Message            string `json:"Message"`
	ParsedMessage      map[string]string
	Namespace          string
	ResourceName       string
	ResourceProperties ResourceProperties
	Updatable          bool
}

MessageBody will parse the message from the Body of SQS

func (*MessageBody) IsComplete

func (m *MessageBody) IsComplete() bool

IsComplete returns a simple status instead of the raw CFT resp

func (*MessageBody) ParseMessage

func (m *MessageBody) ParseMessage() error

ParseMessage will take the message attribute and make it readable

type Policy

type Policy struct {
	Version   string      `json:"Version"`
	ID        string      `json:"Id"`
	Statement []Statement `json:"Statement"`
}

Policy wraps the JSON policy

type Queue

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

Queue wraps the config object for updating

func New

func New(config *config.Config, context *opkit.Context, awsclientset awsclient.ServiceoperatorV1alpha1Interface, timeout int) *Queue

New will initialize the Queue object for watching

func (*Queue) Register

func (q *Queue) Register(name string, obj interface{}) (topicARN string, queueURL string, queueAttrs map[string]*string, subARN string)

Register will create all the affilate resources

func (*Queue) StartWatch

func (q *Queue) StartWatch(h Handler, stopCh <-chan struct{})

StartWatch will start a go routine to watch for new events to store in etcd

type ResourceProperties

type ResourceProperties struct {
	Tags []Tag `json:"Tags"`
}

ResourceProperties will wrap the ResourceProperties object

type Statement

type Statement struct {
	Sid       string    `json:"Sid"`
	Effect    string    `json:"Effect"`
	Principal string    `json:"Principal"`
	Action    []string  `json:"Action"`
	Resource  string    `json:"Resource"`
	Condition Condition `json:"Condition"`
}

Statement defines the QueuePolicy Statement

type Tag

type Tag struct {
	Key   string `json:"Key"`
	Value string `json:"Value"`
}

Tag represents a Tag

Jump to

Keyboard shortcuts

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