notification

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package notification provides bucket notification configuration and event types.

Package notification provides bucket notification event types.

Package notification provides bucket notification configuration types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketMeta added in v1.0.5

type BucketMeta struct {
	Name          string   `json:"name"`
	OwnerIdentity Identity `json:"ownerIdentity"`
	ARN           string   `json:"arn"`
}

BucketMeta holds bucket metadata from an event.

type Config

type Config struct {
	ID     string      `xml:"Id,omitempty"`
	Events []EventType `xml:"Event"`
	Filter *Filter     `xml:"Filter,omitempty"`
}

Config represents a notification configuration target.

type Configuration

type Configuration struct {
	XMLName       xml.Name       `xml:"NotificationConfiguration"`
	LambdaConfigs []LambdaConfig `xml:"CloudFunctionConfiguration,omitempty"`
	TopicConfigs  []TopicConfig  `xml:"TopicConfiguration,omitempty"`
	QueueConfigs  []QueueConfig  `xml:"QueueConfiguration,omitempty"`
}

Configuration represents the full notification configuration.

func ParseConfig added in v1.0.5

func ParseConfig(reader io.Reader) (Configuration, error)

ParseConfig parses a notification configuration from an XML reader.

func (Configuration) ToXML added in v1.0.5

func (c Configuration) ToXML() ([]byte, error)

ToXML marshals the notification configuration to XML.

type Event

type Event struct {
	EventVersion      string            `json:"eventVersion"`
	EventSource       string            `json:"eventSource"`
	AwsRegion         string            `json:"awsRegion"`
	EventTime         string            `json:"eventTime"`
	EventName         string            `json:"eventName"`
	UserIdentity      Identity          `json:"userIdentity"`
	RequestParameters map[string]string `json:"requestParameters"`
	ResponseElements  map[string]string `json:"responseElements"`
	S3                EventMeta         `json:"s3"`
	Source            SourceInfo        `json:"source"`
}

Event represents an S3 bucket notification event.

type EventMeta added in v1.0.5

type EventMeta struct {
	SchemaVersion   string     `json:"s3SchemaVersion"`
	ConfigurationID string     `json:"configurationId"`
	Bucket          BucketMeta `json:"bucket"`
	Object          ObjectMeta `json:"object"`
}

EventMeta holds S3 metadata from an event.

type EventType

type EventType string

EventType represents a bucket notification event.

const (
	ObjectCreatedAll                     EventType = "s3:ObjectCreated:*"
	ObjectCreatedPut                     EventType = "s3:ObjectCreated:Put"
	ObjectCreatedPost                    EventType = "s3:ObjectCreated:Post"
	ObjectCreatedCopy                    EventType = "s3:ObjectCreated:Copy"
	ObjectCreatedCompleteMultipartUpload EventType = "s3:ObjectCreated:CompleteMultipartUpload"
	ObjectRemovedAll                     EventType = "s3:ObjectRemoved:*"
	ObjectRemovedDelete                  EventType = "s3:ObjectRemoved:Delete"
	ObjectRemovedDeleteMarkerCreated     EventType = "s3:ObjectRemoved:DeleteMarkerCreated"
	ObjectAccessedAll                    EventType = "s3:ObjectAccessed:*"
	ObjectAccessedGet                    EventType = "s3:ObjectAccessed:Get"
	ObjectAccessedHead                   EventType = "s3:ObjectAccessed:Head"
)

type Filter

type Filter struct {
	S3Key S3Key `xml:"S3Key,omitempty"`
}

Filter defines notification filters.

type FilterRule

type FilterRule struct {
	Name  string `xml:"Name"`
	Value string `xml:"Value"`
}

FilterRule defines a prefix/suffix filter rule.

type Identity added in v1.0.5

type Identity struct {
	PrincipalID string `json:"principalId"`
}

Identity represents the user identity in notification records.

type Info

type Info struct {
	Records []Event `json:"Records"`
	Err     error   `json:"-"`
}

Info represents notification events and any errors encountered.

type LambdaConfig

type LambdaConfig struct {
	Config
	Lambda string `xml:"CloudFunction"`
}

LambdaConfig carries one lambda notification configuration.

type ObjectMeta added in v1.0.5

type ObjectMeta struct {
	Key          string            `json:"key"`
	Size         int64             `json:"size,omitempty"`
	ETag         string            `json:"eTag,omitempty"`
	ContentType  string            `json:"contentType,omitempty"`
	UserMetadata map[string]string `json:"userMetadata,omitempty"`
	VersionID    string            `json:"versionId,omitempty"`
	Sequencer    string            `json:"sequencer"`
}

ObjectMeta holds object metadata from an event.

type QueueConfig

type QueueConfig struct {
	Config
	Queue string `xml:"Queue"`
}

QueueConfig carries one queue notification configuration.

type S3Key

type S3Key struct {
	FilterRules []FilterRule `xml:"FilterRule,omitempty"`
}

S3Key carries prefix/suffix rules for notification filters.

type SourceInfo added in v1.0.5

type SourceInfo struct {
	Host      string `json:"host"`
	Port      string `json:"port"`
	UserAgent string `json:"userAgent"`
}

SourceInfo represents information about the client that triggered the event.

type TopicConfig

type TopicConfig struct {
	Config
	Topic string `xml:"Topic"`
}

TopicConfig carries one topic notification configuration.

Jump to

Keyboard shortcuts

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