method

Backend.Put

Atomically and durably write an object with its declared size.

Arguments

ArgumentTypeDescription
ctxcontext.ContextThe ctx value.
keystringThe key value.
sourceio.ReaderThe source value.
sizeint64The size value.
_stringThe _ value.

Returns

The declared result.

result error

How it works

The local backend does not persist contentType. It rejects traversal/path-shaped object keys and size mismatches, and preserves an existing object when a replacement fails.

Full signature

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

Source adapters/storage/local/local.go:134

Related types

  • Backend

    A filesystem implementation of storage.Backend.