Documentation
¶
Index ¶
- func HandleDeleteAttachment(c *gin.Context, store registrystore.MemoryStore, ...)
- func HandleDownloadByToken(c *gin.Context, store registrystore.MemoryStore, ...)
- func HandleDownloadURL(c *gin.Context, store registrystore.MemoryStore, ...)
- func HandleGetAttachment(c *gin.Context, store registrystore.MemoryStore, ...)
- func HandleGetAttachmentMetadata(c *gin.Context, store registrystore.MemoryStore)
- func HandleUpload(c *gin.Context, store registrystore.MemoryStore, ...)
- func NewSourceURLTransportForTest(allowPrivate bool) http.RoundTripper
- func ParseCallerAttachmentID(raw *string) (id uuid.UUID, present bool, err error)
- func ParseCallerAttachmentIDJSON(raw json.RawMessage) (id uuid.UUID, present bool, err error)
- func SignDownloadToken(storageKey string, secret []byte, expiresAt time.Time) string
- func SignedURLOptions(disposition string, filename *string) *registryattach.SignedURLOptions
- func StartFencedSourceURLAttachmentDownload(parentCtx context.Context, store registrystore.MemoryStore, ...)
- func ValidateSourceURLForTest(raw string, allowPrivate bool) error
- type ResponsePolicy
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
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
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
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.
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.