notifications

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: AGPL-3.0 Imports: 9 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 added in v0.20.0

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 added in v0.20.0

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

func (*Controller) SendNotifications added in v0.20.0

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

func (*Controller) SendTestNotification added in v0.20.0

func (c *Controller) SendTestNotification(topic, bucketName, requestID, HostID string) error

func (*Controller) Subscribe added in v0.20.0

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

type Event added in v0.20.0

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

type EventRecord added in v0.20.0

type EventRecord struct {
	EventVersion      string            `json:"eventVersion"`
	EventSource       string            `json:"eventSource"`         // neofs: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 added in v0.20.0

type Object struct {
	Key       string `json:"key"`
	Size      int64  `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 added in v0.20.0

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

type S3Entity added in v0.20.0

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

type Stream added in v0.20.0

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

type TestEvent added in v0.20.0

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

type UserIdentity added in v0.20.0

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