transformer

package
v0.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessIdentifiers added in v0.12.0

type AccessIdentifiers struct {
	// contains filtered or unexported fields
}

AccessIdentifiers groups the result of the writing object operation.

func (AccessIdentifiers) SelfID added in v0.12.0

func (a AccessIdentifiers) SelfID() oid.ID

SelfID returns identifier of the written object.

func (*AccessIdentifiers) WithSelfID added in v0.12.0

func (a *AccessIdentifiers) WithSelfID(v oid.ID) *AccessIdentifiers

WithSelfID returns AccessIdentifiers with passed self identifier.

type ObjectTarget added in v0.12.0

type ObjectTarget interface {
	// WriteHeader writes object header w/ payload part.
	// The payload of the object may be incomplete.
	//
	// Must be called exactly once. Control remains with the caller.
	// Missing a call or re-calling can lead to undefined behavior
	// that depends on the implementation.
	//
	// Must not be called after Close call.
	WriteHeader(*object.Object) error

	// Write writes object payload chunk.
	//
	// Can be called multiple times.
	//
	// Must not be called after Close call.
	io.Writer

	// Close is used to finish object writing.
	//
	// Close must return access identifiers of the object
	// that has been written.
	//
	// Must be called no more than once. Control remains with the caller.
	// Re-calling can lead to undefined behavior
	// that depends on the implementation.
	Close() (*AccessIdentifiers, error)
}

ObjectTarget is an interface of the object writer.

func NewPayloadSizeLimiter added in v0.12.0

func NewPayloadSizeLimiter(maxSize uint64, withoutHomomorphicHash bool, signer neofscrypto.Signer,
	sToken *session.Object, nState netmap.State, nextTargetInit TargetInitializer) ObjectTarget

NewPayloadSizeLimiter returns ObjectTarget instance that restricts payload length of the writing object and writes generated objects to targets from initializer.

Calculates and adds homomorphic hash to resulting objects only if withoutHomomorphicHash is false.

Objects w/ payload size less or equal than max size remain untouched.

type TargetInitializer added in v0.12.0

type TargetInitializer func() ObjectTarget

TargetInitializer represents ObjectTarget constructor.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL