event

package
v3.0.24 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

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

Bucket represents bucket metadata of the event.

type ErrInvalidEventName

type ErrInvalidEventName struct {
	Name string
}

ErrInvalidEventName - invalid event name error.

func (ErrInvalidEventName) Error

func (err ErrInvalidEventName) Error() string

type Event

type Event struct {
	EventVersion      string            `json:"eventVersion"`
	EventSource       string            `json:"eventSource"`
	AwsRegion         string            `json:"awsRegion"`
	EventTime         string            `json:"eventTime"`
	EventName         Name              `json:"eventName"`
	UserIdentity      Identity          `json:"userIdentity"`
	RequestParameters map[string]string `json:"requestParameters"`
	ResponseElements  map[string]string `json:"responseElements"`
	S3                Metadata          `json:"s3"`
	Source            Source            `json:"source"`
	Type              madmin.TraceType  `json:"-"`
}

Event represents event notification information defined in http://docs.aws.amazon.com/AmazonS3/latest/dev/notification-content-structure.html.

func (Event) Mask

func (e Event) Mask() uint64

Mask returns the type as mask.

type Identity

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

Identity represents access key who caused the event.

type Log

type Log struct {
	EventName Name
	Key       string
	Records   []Event
}

Log represents event information for some event targets.

type Metadata

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

Metadata represents event metadata.

type Name

type Name int

Name - event type enum. Refer http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html#notification-how-to-event-types-and-destinations for most basic values we have since extend this and its not really much applicable other than a reference point. "s3:Replication:OperationCompletedReplication" is a MinIO extension.

const (
	ObjectAccessedGet Name = 1 + iota
	ObjectAccessedGetRetention
	ObjectAccessedGetLegalHold
	ObjectAccessedHead
	ObjectCreatedCompleteMultipartUpload
	ObjectCreatedCopy
	ObjectCreatedPost
	ObjectCreatedPut
	ObjectCreatedPutRetention
	ObjectCreatedPutLegalHold
	ObjectCreatedPutTagging
	ObjectCreatedDeleteTagging
	ObjectRemovedDelete
	ObjectRemovedDeleteMarkerCreated
	BucketCreated
	BucketRemoved
	ObjectReplicationFailed
	ObjectReplicationComplete
	ObjectReplicationMissedThreshold
	ObjectReplicationReplicatedAfterThreshold
	ObjectReplicationNotTracked
	ObjectRestorePost
	ObjectRestoreCompleted
	ObjectTransitionFailed
	ObjectTransitionComplete
	ObjectManyVersions
	PrefixManyFolders

	ObjectAccessedAll
	ObjectCreatedAll
	ObjectRemovedAll
	ObjectReplicationAll
	ObjectRestoreAll
	ObjectTransitionAll
	ObjectScannerAll
	Everything
)

Values of event Name

func ParseName

func ParseName(s string) (Name, error)

ParseName - parses string to Name.

func (Name) Expand

func (name Name) Expand() []Name

Expand - returns expanded values of abbreviated event type.

func (Name) MarshalJSON

func (name Name) MarshalJSON() ([]byte, error)

MarshalJSON - encodes to JSON data.

func (Name) MarshalXML

func (name Name) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML - encodes to XML data.

func (Name) Mask

func (name Name) Mask() uint64

Mask returns the type as mask. Compound "All" types are expanded.

func (Name) String

func (name Name) String() string

String - returns string representation of event type.

func (*Name) UnmarshalJSON

func (name *Name) UnmarshalJSON(data []byte) error

UnmarshalJSON - decodes JSON data.

func (*Name) UnmarshalXML

func (name *Name) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML - decodes XML data.

type Object

type Object 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"`
}

Object represents object metadata of the event.

type Source

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

Source represents client information who triggered the event.

Jump to

Keyboard shortcuts

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