Documentation ¶
Overview ¶
Package s3 provides structs for working with AWS S3 records.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleFunc ¶
func HandleFunc(h HandlerFunc)
HandleFunc handles S3 events with callback function.
Types ¶
type Bucket ¶
type Bucket struct { Name string `json:"name"` OwnerIdentity struct { PrincipalID string `json:"principalId"` } `json:"ownerIdentity"` ARN string `json:"arn"` }
Bucket is an S3 bucket.
type Event ¶
type Event struct {
Records []*Record `json:"Records"`
}
Event represents a S3 event with one or more records.
type HandlerFunc ¶
HandlerFunc unmarshals S3 events before passing control.
func (HandlerFunc) Handle ¶
func (h HandlerFunc) Handle(data json.RawMessage, ctx *apex.Context) (interface{}, error)
Handle implements apex.Handler.
type Object ¶
type Object struct { Key string `json:"key"` Size int `json:"size"` ETag string `json:"eTag"` VersionID string `json:"versionId"` Sequencer string `json:"sequencer"` }
Object is an S3 object.
type Record ¶
type Record 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"` S3 struct { SchemaVersion string `json:"s3SchemaVersion"` ConfigurationID string `json:"configurationId"` Bucket *Bucket `json:"bucket"` Object *Object `json:"object"` } }
Record represents a single S3 record.
Click to show internal directories.
Click to hide internal directories.