Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultReaderBufferSize = 64 * 1024
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Params ¶
type Params struct { // Original object header. Header *objectSDK.Object // Range provider. RangeProvider RangeProvider // ObjectWriter is the writer that writes the patched object. ObjectWriter transformer.ChunkedObjectWriter // The size of the buffer used by the original payload range reader. // If it's set to <=0, then `DefaultReaderBufferSize` is used. ReaderBufferSize int }
Params is parameters to initialize patcher.
type PatchApplier ¶
type PatchApplier interface { // ApplyAttributesPatch applies the patch only for the object's attributes. // // ApplyAttributesPatch can't be invoked few times, otherwise it returns `ErrAttrPatchAlreadyApplied` error. // // The call is idempotent for the original header if it's invoked with empty `newAttrs` and // `replaceAttrs = false`. ApplyAttributesPatch(ctx context.Context, newAttrs []objectSDK.Attribute, replaceAttrs bool) error // ApplyPayloadPatch applies the patch for the object's payload. // // ApplyPayloadPatch returns `ErrPayloadPatchIsNil` error if patch is nil. ApplyPayloadPatch(ctx context.Context, payloadPatch *objectSDK.PayloadPatch) error // Close closes PatchApplier when the patch stream is over. Close(context.Context) (PatchRes, error) }
PatchApplier is the interface that provides method to apply header and payload patches.
func New ¶
func New(prm Params) PatchApplier
type PatchRes ¶
type PatchRes struct {
AccessIdentifiers *transformer.AccessIdentifiers
}
PatchRes is the result of patch application.
type RangeProvider ¶
type RangeProvider interface { // GetRange reads an original object payload by the given range. // The method returns io.Reader over the data range only. This means if the data is read out, // then GetRange has to be invoked to provide reader over the next range. GetRange(ctx context.Context, rng *objectSDK.Range) io.Reader }
RangeProvider is the interface that provides a method to get original object payload by a given range.
Click to show internal directories.
Click to hide internal directories.