attachments

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleDeleteAttachment

func HandleDeleteAttachment(c *gin.Context, store registrystore.MemoryStore, attachStore registryattach.AttachmentStore)

HandleDeleteAttachment exposes attachment delete for wrapper-native adapters.

func HandleDownloadByToken

func HandleDownloadByToken(c *gin.Context, store registrystore.MemoryStore, attachStore registryattach.AttachmentStore, signingKeys [][]byte)

HandleDownloadByToken exposes token download for wrapper-native adapters.

func HandleDownloadURL

func HandleDownloadURL(c *gin.Context, store registrystore.MemoryStore, attachStore registryattach.AttachmentStore, cfg *config.Config, signingKey []byte)

HandleDownloadURL exposes attachment signed URL issuance for wrapper-native adapters.

func HandleGetAttachment

func HandleGetAttachment(c *gin.Context, store registrystore.MemoryStore, attachStore registryattach.AttachmentStore, cfg *config.Config)

HandleGetAttachment exposes attachment retrieval for wrapper-native adapters.

func HandleUpload

func HandleUpload(c *gin.Context, store registrystore.MemoryStore, attachStore registryattach.AttachmentStore, cfg *config.Config)

HandleUpload exposes attachment upload/create for wrapper-native adapters.

func NewSourceURLTransportForTest

func NewSourceURLTransportForTest(allowPrivate bool) http.RoundTripper

func SignDownloadToken added in v0.1.0

func SignDownloadToken(storageKey string, secret []byte, expiresAt time.Time) string

SignDownloadToken returns the HMAC token used by public attachment download URLs.

func SignedURLOptions added in v0.1.0

func SignedURLOptions(disposition string, filename *string) *registryattach.SignedURLOptions

SignedURLOptions returns the S3 signing options for a disposition/filename pair.

func StartSourceURLAttachmentDownload added in v0.1.0

func StartSourceURLAttachmentDownload(store registrystore.MemoryStore, attachStore registryattach.AttachmentStore, cfg *config.Config, attachmentID uuid.UUID, userID, sourceURL, contentType string)

StartSourceURLAttachmentDownload starts the same asynchronous source URL download workflow used by the REST attachment API.

func ValidateSourceURLForTest

func ValidateSourceURLForTest(raw string, allowPrivate bool) error

Types

type ResponsePolicy added in v0.1.0

type ResponsePolicy = responsePolicy

ResponsePolicy is the attachment response policy shared by REST and gRPC attachment download URL handlers.

func AttachmentResponsePolicy added in v0.1.0

func AttachmentResponsePolicy(contentType, requestedDisposition string) ResponsePolicy

AttachmentResponsePolicy returns the content/disposition/direct-download policy for an attachment response.

Jump to

Keyboard shortcuts

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