method

Backend.Put

Upload a size-checked object using a SigV4 payload hash.

Arguments

ArgumentTypeDescription
ctxcontext.ContextThe ctx value.
keystringThe key value.
sourceio.ReaderThe source value.
sizeint64The size value.
contentTypestringThe contentType value.

Returns

The declared result.

result error

How it works

Seekable inputs are hashed then rewound. Non-seekable inputs use a bounded temporary spool that is cleaned on success, error, or cancellation.

Full signature

func (backend *Backend) Put( ctx context.Context, key string, source io.Reader, size int64, contentType string, ) (result error)

Source adapters/storage/s3/s3.go:124

Related types

  • Backend

    An S3 storage and URL-signing backend.