util

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IterateAllSplitLeaves added in v0.14.0

func IterateAllSplitLeaves(r HeadReceiver, addr *objectSDK.Address, h func(*object.Object)) error

IterateAllSplitLeaves is an iterator over all object split-tree leaves in direct order.

func IterateSplitLeaves added in v0.14.0

func IterateSplitLeaves(r HeadReceiver, addr *objectSDK.Address, h func(*object.Object) bool) error

IterateSplitLeaves is an iterator over object split-tree leaves in direct order.

If member handler returns true, then the iterator aborts without error.

func LogServiceError added in v0.12.1

func LogServiceError(l *logger.Logger, req string, node network.AddressGroup, err error)

LogServiceError writes debug error message of object service to provided logger.

func LogWorkerPoolError added in v0.12.1

func LogWorkerPoolError(l *logger.Logger, req string, err error)

LogWorkerPoolError writes debug error message of object worker pool to provided logger.

func NewRemotePlacementBuilder added in v0.13.0

func NewRemotePlacementBuilder(b placement.Builder, s netmap.AnnouncedKeys) placement.Builder

NewRemotePlacementBuilder creates, initializes and returns placement builder that excludes local node from any placement vector.

func TraverseSplitChain added in v0.14.0

func TraverseSplitChain(r HeadReceiver, addr *objectSDK.Address, h SplitMemberHandler) error

TraverseSplitChain is an iterator over object split-tree leaves.

Traversal occurs in one of two directions, which depends on what pslit info was received: * in direct order for link part; * in reverse order for last part.

Types

type CommonPrm

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

func CommonPrmFromV2

func CommonPrmFromV2(req interface {
	GetMetaHeader() *session.RequestMetaHeader
}) (*CommonPrm, error)

func (*CommonPrm) BearerToken

func (p *CommonPrm) BearerToken() *token.BearerToken

func (*CommonPrm) LocalOnly

func (p *CommonPrm) LocalOnly() bool

func (*CommonPrm) NetmapEpoch added in v0.14.1

func (p *CommonPrm) NetmapEpoch() uint64

func (*CommonPrm) NetmapLookupDepth added in v0.14.1

func (p *CommonPrm) NetmapLookupDepth() uint64

func (*CommonPrm) RemoteCallOptions added in v0.13.0

func (p *CommonPrm) RemoteCallOptions(dynamic ...DynamicCallOption) []client.CallOption

RemoteCallOptions return call options for remote client calls.

func (*CommonPrm) SessionToken

func (p *CommonPrm) SessionToken() *sessionsdk.Token

func (*CommonPrm) SetNetmapLookupDepth added in v0.14.1

func (p *CommonPrm) SetNetmapLookupDepth(v uint64)

func (*CommonPrm) WithBearerToken

func (p *CommonPrm) WithBearerToken(token *token.BearerToken) *CommonPrm

func (*CommonPrm) WithLocalOnly

func (p *CommonPrm) WithLocalOnly(v bool) *CommonPrm

func (*CommonPrm) WithRemoteCallOptions added in v0.13.0

func (p *CommonPrm) WithRemoteCallOptions(opts ...client.CallOption) *CommonPrm

WithRemoteCallOptions sets call options remote remote client calls.

func (*CommonPrm) WithSessionToken

func (p *CommonPrm) WithSessionToken(token *sessionsdk.Token) *CommonPrm

type DynamicCallOption added in v0.14.1

type DynamicCallOption func(*remoteCallOpts)

func WithKey added in v0.17.0

func WithKey(key *ecdsa.PrivateKey) DynamicCallOption

WithKey sets key to use for the request.

func WithNetmapEpoch added in v0.14.1

func WithNetmapEpoch(v uint64) DynamicCallOption

type HeadReceiver added in v0.14.0

type HeadReceiver interface {
	// Head must return one of:
	// * object header (*object.Object);
	// * structured information about split-chain (*objectSDK.SplitInfo).
	Head(*objectSDK.Address) (interface{}, error)
}

HeadReceiver is an interface of entity that can receive object header or the information about the object relations.

type KeyStorage

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

KeyStorage represents private key storage of the local node.

func NewKeyStorage

func NewKeyStorage(localKey *ecdsa.PrivateKey, tokenStore *storage.TokenStore, net netmap.State) *KeyStorage

NewKeyStorage creates, initializes and returns new KeyStorage instance.

func (*KeyStorage) GetKey

func (s *KeyStorage) GetKey(token *session.Token) (*ecdsa.PrivateKey, error)

GetKey returns private key of the node.

If token is not nil, session private key is returned. Otherwise, node private key is returned.

type SplitMemberHandler added in v0.14.0

type SplitMemberHandler func(member *object.Object, reverseDirection bool) (stop bool)

SplitMemberHandler is a handler of next split-chain element.

If reverseDirection arg is true, then the traversal is done in reverse order. Stop boolean result provides the ability to interrupt the traversal.

type TraverserGenerator added in v0.13.0

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

TraverserGenerator represents tool that generates container traverser for the particular need.

func NewTraverserGenerator added in v0.13.0

func NewTraverserGenerator(nmSrc netmap.Source, cnrSrc container.Source, netmapKeys netmap.AnnouncedKeys) *TraverserGenerator

NewTraverserGenerator creates, initializes and returns new TraverserGenerator instance.

func (*TraverserGenerator) GenerateTraverser added in v0.13.0

func (g *TraverserGenerator) GenerateTraverser(addr *object.Address, epoch uint64) (*placement.Traverser, error)

GenerateTraverser generates placement Traverser for provided object address using epoch-th network map.

func (*TraverserGenerator) WithTraverseOptions added in v0.13.0

func (g *TraverserGenerator) WithTraverseOptions(opts ...placement.Option) *TraverserGenerator

WithTraverseOptions returns TraverseGenerator that additionally applies provided options.

Jump to

Keyboard shortcuts

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