Documentation
¶
Overview ¶
Package multipartupload demonstrates a bounded-memory redact, Zstandard, and multipart-upload pipeline. Plaintext flows directly from src into the redactor; it is never written to an intermediate file.
Index ¶
Constants ¶
View Source
const ( DefaultPartSize = 8 * 1024 * 1024 // MaxParts matches the common S3 multipart limit and also bounds retained // part metadata independently of input size. MaxParts = 10_000 )
Variables ¶
This section is empty.
Functions ¶
func RedactCompressUpload ¶
func RedactCompressUpload(ctx context.Context, client Client, engine *goredact.Engine, src io.Reader, opts Options) (goredact.Stats, error)
RedactCompressUpload streams src through engine and a Zstandard writer into multipart upload. At most PartSize plus the engine's fixed buffers are held in memory. Any scan, compression, upload, completion, or cancellation error causes Abort to be attempted with a fresh bounded context.
Types ¶
type Client ¶
type Client interface {
Begin(context.Context) (Upload, error)
UploadPart(context.Context, Upload, int, io.Reader, int64) (Part, error)
Complete(context.Context, Upload, []Part) error
Abort(context.Context, Upload) error
}
Client is the storage-specific multipart adapter. Implementations should make UploadPart consume body before returning.
Click to show internal directories.
Click to hide internal directories.