Documentation
¶
Overview ¶
Package http connects typed HTTP file inputs and responses to storage disks. Authorization and file validation remain the consuming endpoint's policies.
Index ¶
- func Download(disk *storage.Disk, key storage.ObjectKey, options storage.ReadOptions) foundryhttp.Download
- func StoreUpload(ctx context.Context, disk *storage.Disk, key storage.ObjectKey, ...) (storage.StoredObject, error)
- func Stream(disk *storage.Disk, key storage.ObjectKey, options storage.ReadOptions) foundryhttp.Stream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Download ¶
func Download(disk *storage.Disk, key storage.ObjectKey, options storage.ReadOptions) foundryhttp.Download
Download defers opening until the typed HTTP handler and authorization succeed. It reuses Foundry's download response, including HEAD, conditional requests, byte ranges, presentation validation and automatic reader cleanup. Seeking streams provider ranges; no complete-object buffer or temporary download file is needed. Signed HTTP endpoints can protect local downloads with the existing URL signer. Never serve a managed local store with a filesystem file server.
func StoreUpload ¶
func StoreUpload(ctx context.Context, disk *storage.Disk, key storage.ObjectKey, file foundryhttp.UploadedFile, options storage.PutOptions) (storage.StoredObject, error)
StoreUpload persists a captured request-owned upload before the request ends. It uses the supplied key, never the client's filename. Existing HTTP upload limits, validation, bounded spooling and request cleanup remain in force. Detected media type is a default only; it is not proof of a valid file format. A successful StoredObject can be retained; UploadedFile cannot outlive requests.
func Stream ¶
func Stream(disk *storage.Disk, key storage.ObjectKey, options storage.ReadOptions) foundryhttp.Stream
Stream works with any storage backend and defers opening to the response phase. It describes a finite stream with a known length; HTTP byte-range and validator negotiation require Download. WithName controls presentation, not object keys.
Types ¶
This section is empty.