attachments

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 32 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func HandleGetAttachmentMetadata(c *gin.Context, store registrystore.MemoryStore)

HandleGetAttachmentMetadata exposes the metadata-only attachment lookup 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 ParseCallerAttachmentID added in v0.6.0

func ParseCallerAttachmentID(raw *string) (id uuid.UUID, present bool, err error)

ParseCallerAttachmentID validates the optional caller-supplied attachment ID. A nil raw means the caller sent no ID. An empty or malformed value is an error, as is the nil UUID, so a present-but-blank field is never mistaken for an absent one.

func ParseCallerAttachmentIDJSON added in v0.6.0

func ParseCallerAttachmentIDJSON(raw json.RawMessage) (id uuid.UUID, present bool, err error)

ParseCallerAttachmentIDJSON validates the optional caller-supplied ID of a JSON request body. raw is nil only when the key was absent. The contract makes id optional but not nullable, so an explicit null, like any other non-string value, is rejected instead of silently taking the no-ID path.

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

func StartFencedSourceURLAttachmentDownload(parentCtx context.Context, store registrystore.MemoryStore, attachStore registryattach.AttachmentStore, cfg *config.Config, attachmentID, attemptID uuid.UUID, userID, sourceURL, contentType string)

StartFencedSourceURLAttachmentDownload starts the asynchronous source URL download for a row this request just created. attemptID is the attempt that created the row; the download finalizes or fails the row only while that attempt is still current.

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