webhook

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrUnableToParseRequestBody = "unable to parse request body"
	ErrNoEventsProvided         = "no events provided"
	ErrUnableToExtractID        = "unable to extract ID"
	ErrAttachmentNotFount       = "attachment not found"
	ErrUnableToDoneAttachment   = "unable to done attachment"
	ErrUnableToRemoveAttachment = "unable to remove attachment"
	ErrIncorrectFileSize        = "incorrect file size"
)
View Source
const (
	S3EventPut    = "s3:ObjectCreated:Put"
	S3EventDelete = "s3:ObjectRemoved:Delete"
)

Variables

This section is empty.

Functions

func New

func New(dbcon *db.CQLCon, storage *s3.Client, log *slog.Logger) server.Entity

Types

type S3Bucket

type S3Bucket struct {
	Name          string     `json:"name"`
	OwnerIdentity S3Identity `json:"ownerIdentity"`
	ARN           string     `json:"arn"`
}

type S3Element

type S3Element struct {
	S3SchemaVersion string   `json:"s3SchemaVersion"`
	ConfigurationID string   `json:"configurationId"`
	Bucket          S3Bucket `json:"bucket"`
	Object          S3Object `json:"object"`
}

type S3Event

type S3Event struct {
	EventName string          `json:"EventName"`
	Key       string          `json:"Key"`
	Records   []S3EventRecord `json:"Records"`
}

type S3EventRecord

type S3EventRecord struct {
	EventVersion      string              `json:"eventVersion"`
	EventSource       string              `json:"eventSource"`
	AWSRegion         string              `json:"awsRegion"`
	EventTime         time.Time           `json:"eventTime"`
	EventName         string              `json:"eventName"`
	UserIdentity      S3Identity          `json:"userIdentity"`
	RequestParameters S3RequestParameters `json:"requestParameters"`
	ResponseElements  map[string]string   `json:"responseElements"`
	S3                S3Element           `json:"s3"`
	Source            S3Source            `json:"source"`
}

type S3Identity

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

type S3Object

type S3Object struct {
	Key          string            `json:"key"`
	Size         int64             `json:"size"`
	ETag         string            `json:"eTag"`
	ContentType  *string           `json:"contentType"`
	UserMetadata map[string]string `json:"userMetadata"`
	Sequencer    string            `json:"sequencer"`
}

type S3RequestParameters

type S3RequestParameters struct {
	PrincipalID     string `json:"principalId"`
	Region          string `json:"region"`
	SourceIPAddress string `json:"sourceIPAddress"`
}

type S3Source

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

Jump to

Keyboard shortcuts

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