transformer

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// PrivateSessionToken is a context key for session.PrivateToken.
	PrivateSessionToken = "private token"

	// PublicSessionToken is a context key for service.SessionToken.
	PublicSessionToken = "public token"
)

Variables

View Source
var ErrInvalidSGLinking = errors.New("invalid storage group linking")

ErrInvalidSGLinking is returned by Transformer that received an object with broken storage group links.

View Source
var ErrPayloadEOF = errors.New("payload EOF")

ErrPayloadEOF is returned by Transformer that received unexpected end of object payload.

Functions

This section is empty.

Types

type CID

type CID = refs.CID

CID is a type alias of CID from refs package of neofs-api-go.

type EpochReceiver

type EpochReceiver interface {
	Epoch() uint64
}

EpochReceiver is an interface of epoch number container with read access.

type Object

type Object = object.Object

Object is a type alias of Object from object package of neofs-api-go.

func GetChain

func GetChain(srcObjs ...Object) ([]Object, error)

GetChain builds a list of objects in the hereditary chain. In case of impossibility to do this, an error is returned.

type ObjectID

type ObjectID = refs.ObjectID

ObjectID is a type alias of ObjectID from refs package of neofs-api-go.

type ObjectRestorer

type ObjectRestorer interface {
	Type() object.Transform_Type
	Restore(context.Context, ...Object) ([]Object, error)
}

ObjectRestorer is an interface of object restorer.

func NewRestorePipeline

func NewRestorePipeline(t ...ObjectRestorer) ObjectRestorer

NewRestorePipeline is a constructor of the pipeline of object restorers.

func SplitRestorer

func SplitRestorer() ObjectRestorer

SplitRestorer is a splitted object restorer's constructor.

type Params

type Params struct {
	SGInfoReceiver storagegroup.InfoReceiver
	EpochReceiver  EpochReceiver
	SizeLimit      uint64
	Verifier       verifier.Verifier
}

Params groups the parameters of object transformer's constructor.

type ProcUnit

type ProcUnit struct {
	Head    *Object
	Payload io.Reader
}

ProcUnit groups the information about transforming unit.

func EmptyPayloadUnit

func EmptyPayloadUnit(head *Object) ProcUnit

EmptyPayloadUnit returns ProcUnit with Object from argument and empty payload reader that always returns (0, io.EOF).

type ProcUnitHandler

type ProcUnitHandler func(context.Context, ProcUnit) error

ProcUnitHandler is a handling ProcUnit function.

type StorageGroup

type StorageGroup = storagegroup.StorageGroup

StorageGroup is a type alias of StorageGroup from storagegroup package of neofs-api-go.

type Transformer

type Transformer interface {
	Transform(context.Context, ProcUnit, ...ProcUnitHandler) error
}

Transformer is an interface of object transformer.

func NewTransformer

func NewTransformer(p Params) (Transformer, error)

NewTransformer is an object transformer's constructor.

type Type

type Type = object.Transform_Type

Type is a type alias of Type from object package of neofs-api-go.

Jump to

Keyboard shortcuts

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