notifications

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout = 30 * time.Second

	// EventVersion23 is used for lifecycle, tiering, objectACL, objectTagging, object restoration notifications.
	EventVersion23 = "2.3"
	// EventVersion22 is used for replication notifications.
	EventVersion22 = "2.2"
	// EventVersion21 is used for all other notification types.
	EventVersion21 = "2.1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	Name          string       `json:"name"`
	OwnerIdentity UserIdentity `json:"ownerIdentity,omitempty"`
	Arn           string       `json:"arn,omitempty"`
}

type Controller

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

func NewController

func NewController(p *Options, l *zap.Logger) (*Controller, error)

func (*Controller) Listen

func (c *Controller) Listen(ctx context.Context)

func (*Controller) SendNotifications

func (c *Controller) SendNotifications(topics map[string]string, p *handler.SendNotificationParams) error

func (*Controller) SendTestNotification

func (c *Controller) SendTestNotification(topic, bucketName, requestID, HostID string, now time.Time) error

func (*Controller) Subscribe

func (c *Controller) Subscribe(_ context.Context, topic string, handler layer.MsgHandler) error

type Event

type Event struct {
	Records []EventRecord `json:"Records"`
}

type EventRecord

type EventRecord struct {
	EventVersion      string            `json:"eventVersion"`
	EventSource       string            `json:"eventSource"`         // frostfs:s3
	AWSRegion         string            `json:"awsRegion,omitempty"` // empty
	EventTime         time.Time         `json:"eventTime"`
	EventName         string            `json:"eventName"`
	UserIdentity      UserIdentity      `json:"userIdentity"`
	RequestParameters RequestParameters `json:"requestParameters"`
	ResponseElements  map[string]string `json:"responseElements"`
	S3                S3Entity          `json:"s3"`
}

type Object

type Object struct {
	Key       string `json:"key"`
	Size      uint64 `json:"size,omitempty"`
	VersionID string `json:"versionId,omitempty"`
	ETag      string `json:"eTag,omitempty"`
	Sequencer string `json:"sequencer,omitempty"`
}

type Options

type Options struct {
	URL                       string
	TLSCertFilepath           string
	TLSAuthPrivateKeyFilePath string
	Timeout                   time.Duration
	RootCAFiles               []string
}

type RequestParameters

type RequestParameters struct {
	SourceIPAddress string `json:"sourceIPAddress"`
}

type S3Entity

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

type Stream

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

type TestEvent

type TestEvent struct {
	Service   string
	Event     string
	Time      time.Time
	Bucket    string
	RequestID string
	HostID    string
}

type UserIdentity

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

Jump to

Keyboard shortcuts

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