getsvc

package
v0.0.0-...-79ba347 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChunkWriter

type ChunkWriter interface {
	WriteChunk([]byte) error
}

ChunkWriter is an interface of target component to write payload chunk.

type ClientConstructor

type ClientConstructor interface {
	Get(client.NodeInfo) (client.MultiAddressClient, error)
}

type HeadPrm

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

HeadPrm groups parameters of Head service call.

func (*HeadPrm) SetCommonParameters

func (p *HeadPrm) SetCommonParameters(common *util.CommonPrm)

SetCommonParameters sets common parameters of the operation.

func (*HeadPrm) SetHeaderWriter

func (p *HeadPrm) SetHeaderWriter(w HeaderWriter)

SetHeaderWriter sets target component to write the object header.

func (*HeadPrm) SetRequestForwarder

func (p *HeadPrm) SetRequestForwarder(f RequestForwarder)

func (*HeadPrm) WithAddress

func (p *HeadPrm) WithAddress(addr oid.Address)

WithAddress sets object address to be read.

func (*HeadPrm) WithCachedSignerKey

func (p *HeadPrm) WithCachedSignerKey(signerKey *ecdsa.PrivateKey)

WithCachedSignerKey sets optional key for all further requests.

func (*HeadPrm) WithRawFlag

func (p *HeadPrm) WithRawFlag(raw bool)

WithRawFlag sets flag of raw reading.

type HeaderWriter

type HeaderWriter interface {
	WriteHeader(*object.Object) error
}

HeaderWriter is an interface of target component to write object header.

type ObjectWriter

type ObjectWriter interface {
	HeaderWriter
	ChunkWriter
}

ObjectWriter is an interface of target component to write object.

type Option

type Option func(*cfg)

Option is a Service's constructor option.

func WithClientConstructor

func WithClientConstructor(v ClientConstructor) Option

WithClientConstructor returns option to set constructor of remote node clients.

func WithKeyStorage

func WithKeyStorage(store *util.KeyStorage) Option

WithKeyStorage returns option to set private key storage for session tokens and node key.

func WithLocalStorageEngine

func WithLocalStorageEngine(e *engine.StorageEngine) Option

WithLocalStorageEngine returns option to set local storage instance.

func WithLogger

func WithLogger(l *logger.Logger) Option

WithLogger returns option to specify Get service's logger.

func WithNetMapSource

func WithNetMapSource(nmSrc netmap.Source) Option

WithNetMapSource returns option to set network map storage to receive current network state.

func WithTraverserGenerator

func WithTraverserGenerator(t *util.TraverserGenerator) Option

WithTraverserGenerator returns option to set generator of placement traverser to get the objects from containers.

func WithoutAssembly

func WithoutAssembly() Option

WithoutAssembly returns option to disable object assembling.

type Prm

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

Prm groups parameters of Get service call.

func (*Prm) SetCommonParameters

func (p *Prm) SetCommonParameters(common *util.CommonPrm)

SetCommonParameters sets common parameters of the operation.

func (*Prm) SetObjectWriter

func (p *Prm) SetObjectWriter(w ObjectWriter)

SetObjectWriter sets target component to write the object.

func (*Prm) SetRequestForwarder

func (p *Prm) SetRequestForwarder(f RequestForwarder)

func (*Prm) WithAddress

func (p *Prm) WithAddress(addr oid.Address)

WithAddress sets object address to be read.

func (*Prm) WithCachedSignerKey

func (p *Prm) WithCachedSignerKey(signerKey *ecdsa.PrivateKey)

WithCachedSignerKey sets optional key for all further requests.

func (*Prm) WithRawFlag

func (p *Prm) WithRawFlag(raw bool)

WithRawFlag sets flag of raw reading.

type RangeHashPrm

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

RangeHashPrm groups parameters of GetRange service call.

func (*RangeHashPrm) SetCommonParameters

func (p *RangeHashPrm) SetCommonParameters(common *util.CommonPrm)

SetCommonParameters sets common parameters of the operation.

func (*RangeHashPrm) SetHashGenerator

func (p *RangeHashPrm) SetHashGenerator(v func() hash.Hash)

SetHashGenerator sets constructor of hashing algorithm.

func (*RangeHashPrm) SetRangeList

func (p *RangeHashPrm) SetRangeList(rngs []object.Range)

SetRangeList sets a list of object payload ranges.

func (*RangeHashPrm) SetRequestForwarder

func (p *RangeHashPrm) SetRequestForwarder(f RequestForwarder)

func (*RangeHashPrm) SetSalt

func (p *RangeHashPrm) SetSalt(salt []byte)

SetSalt sets binary salt to XOR object's payload ranges before hash calculation.

func (*RangeHashPrm) WithAddress

func (p *RangeHashPrm) WithAddress(addr oid.Address)

WithAddress sets object address to be read.

func (*RangeHashPrm) WithCachedSignerKey

func (p *RangeHashPrm) WithCachedSignerKey(signerKey *ecdsa.PrivateKey)

WithCachedSignerKey sets optional key for all further requests.

func (*RangeHashPrm) WithRawFlag

func (p *RangeHashPrm) WithRawFlag(raw bool)

WithRawFlag sets flag of raw reading.

type RangeHashRes

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

func (*RangeHashRes) Hashes

func (r *RangeHashRes) Hashes() [][]byte

type RangePrm

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

RangePrm groups parameters of GetRange service call.

func (*RangePrm) SetChunkWriter

func (p *RangePrm) SetChunkWriter(w ChunkWriter)

SetChunkWriter sets target component to write the object payload range.

func (*RangePrm) SetCommonParameters

func (p *RangePrm) SetCommonParameters(common *util.CommonPrm)

SetCommonParameters sets common parameters of the operation.

func (*RangePrm) SetRange

func (p *RangePrm) SetRange(rng *object.Range)

SetRange sets range of the requested payload data.

func (*RangePrm) SetRequestForwarder

func (p *RangePrm) SetRequestForwarder(f RequestForwarder)

func (RangePrm) Validate

func (p RangePrm) Validate() error

Validate pre-validates `OBJECTRANGE` request's parameters content without access to the requested object's payload.

func (*RangePrm) WithAddress

func (p *RangePrm) WithAddress(addr oid.Address)

WithAddress sets object address to be read.

func (*RangePrm) WithCachedSignerKey

func (p *RangePrm) WithCachedSignerKey(signerKey *ecdsa.PrivateKey)

WithCachedSignerKey sets optional key for all further requests.

func (*RangePrm) WithRawFlag

func (p *RangePrm) WithRawFlag(raw bool)

WithRawFlag sets flag of raw reading.

type Service

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

Service utility serving requests of Object.Get service.

func New

func New(opts ...Option) *Service

New creates, initializes and returns utility serving Object.Get service requests.

func (*Service) Get

func (s *Service) Get(ctx context.Context, prm Prm) error

Get serves a request to get an object by address, and returns Streamer instance.

func (*Service) GetRange

func (s *Service) GetRange(ctx context.Context, prm RangePrm) error

GetRange serves a request to get an object by address, and returns Streamer instance.

func (*Service) GetRangeHash

func (s *Service) GetRangeHash(ctx context.Context, prm RangeHashPrm) (*RangeHashRes, error)

func (*Service) Head

func (s *Service) Head(ctx context.Context, prm HeadPrm) error

Head reads object header from container.

Returns ErrNotFound if the header was not received for the call. Returns SplitInfoError if object is virtual and raw flag is set.

type SimpleObjectWriter

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

func NewSimpleObjectWriter

func NewSimpleObjectWriter() *SimpleObjectWriter

func (*SimpleObjectWriter) Object

func (s *SimpleObjectWriter) Object() *object.Object

func (*SimpleObjectWriter) WriteChunk

func (s *SimpleObjectWriter) WriteChunk(p []byte) error

func (*SimpleObjectWriter) WriteHeader

func (s *SimpleObjectWriter) WriteHeader(obj *object.Object) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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