event

package
v0.0.0-...-576ca3e Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CliHandler    EventHandler = "cli"
	SqsHandler    EventHandler = "sqs"
	AssumeRoleArn string
)

Functions

This section is empty.

Types

type Cli

type Cli struct {
	Uri string
}

func (*Cli) GetUri

func (c *Cli) GetUri() (string, error)

func (*Cli) Init

func (c *Cli) Init(cfg string) error

type Event

type Event interface {
	Init(cfg string) error
	GetUri() (string, error)
}

func New

func New(handler EventHandler) Event

type EventHandler

type EventHandler string

type SQSMessage

type SQSMessage struct {
	Records []struct {
		EventVersion string    `json:"eventVersion"`
		EventSource  string    `json:"eventSource"`
		AwsRegion    string    `json:"awsRegion"`
		EventTime    time.Time `json:"eventTime"`
		EventName    string    `json:"eventName"`
		UserIdentity struct {
			PrincipalID string `json:"principalId"`
		} `json:"userIdentity"`
		RequestParameters struct {
			SourceIPAddress string `json:"sourceIPAddress"`
		} `json:"requestParameters"`
		ResponseElements struct {
			XAmzRequestID string `json:"x-amz-request-id"`
			XAmzID2       string `json:"x-amz-id-2"`
		} `json:"responseElements"`
		S3 struct {
			S3SchemaVersion string `json:"s3SchemaVersion"`
			ConfigurationID string `json:"configurationId"`
			Bucket          struct {
				Name          string `json:"name"`
				OwnerIdentity struct {
					PrincipalID string `json:"principalId"`
				} `json:"ownerIdentity"`
				Arn string `json:"arn"`
			} `json:"bucket"`
			Object struct {
				Key       string `json:"key"`
				Size      int    `json:"size"`
				ETag      string `json:"eTag"`
				Sequencer string `json:"sequencer"`
			} `json:"object"`
		} `json:"s3"`
	} `json:"Records"`
}

type Sqs

type Sqs struct {
	QueueUrl string `json:"queueUrl"`
	Uri      string
	// contains filtered or unexported fields
}

func (*Sqs) GetUri

func (s *Sqs) GetUri() (string, error)

func (*Sqs) Init

func (s *Sqs) Init(cfg string) error

Jump to

Keyboard shortcuts

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