implementations

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const BearerToken = "bearer token"

BearerToken is a context key for BearerToken.

View Source
const ErrIncompleteSGInfo = internal.Error("could not receive full storage group info")

ErrIncompleteSGInfo is returned by storage group information receiver that could not receive full information.

View Source
const ExtendedHeaders = "extended headers"

ExtendedHeaders is a context key for X-headers.

View Source
const PublicSessionToken = "public token"

PublicSessionToken is a context key for SessionToken. FIXME: temp solution for cycle import fix.

Unify with same const from transformer pkg.

Variables

This section is empty.

Functions

func ExtendedACLSourceFromBinary

func ExtendedACLSourceFromBinary(v acl.BinaryExtendedACLSource) (acl.ExtendedACLSource, error)

ExtendedACLSourceFromBinary wraps BinaryExtendedACLSource and returns ExtendedACLSource.

If passed BinaryExtendedACLSource is nil, acl.ErrNilBinaryExtendedACLStore returns.

func NewLocalHeadIntegrityVerifier

func NewLocalHeadIntegrityVerifier(keyVerifier core.OwnerKeyVerifier) (objutil.Verifier, error)

NewLocalHeadIntegrityVerifier constructs local object head verifier and returns objutil.Verifier interface.

func NewLocalIntegrityVerifier

func NewLocalIntegrityVerifier(keyVerifier core.OwnerKeyVerifier) (objutil.Verifier, error)

NewLocalIntegrityVerifier constructs local object verifier and returns objutil.Verifier interface.

func NewObjectLocator

func NewObjectLocator(p LocatorParams) (replication.ObjectLocator, error)

NewObjectLocator constructs replication.ObjectLocator from SelectiveContainerExecutor.

func NewObjectValidator

func NewObjectValidator(p *ObjectValidatorParams) (replication.ObjectVerifier, error)

NewObjectValidator constructs universal replication.ObjectVerifier.

func NewPayloadVerifier

func NewPayloadVerifier() objutil.Verifier

NewPayloadVerifier constructs object payload verifier and returns objutil.Verifier.

func NewStorageGroupInfoReceiver

func NewStorageGroupInfoReceiver(p StorageGroupInfoReceiverParams) (storagegroup.InfoReceiver, error)

NewStorageGroupInfoReceiver constructs storagegroup.InfoReceiver from SelectiveContainerExecutor.

Types

type ACLHelper

type ACLHelper interface {
	BasicACLGetter
	ContainerOwnerChecker
}

ACLHelper is an interface, that provides useful functions for ACL object pre-processor.

func NewACLHelper

func NewACLHelper(cnr container.Storage) (ACLHelper, error)

NewACLHelper returns implementation of the ACLHelper interface.

type Address

type Address = refs.Address

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

type AddressStore

type AddressStore interface {
	SelfAddr() (multiaddr.Multiaddr, error)
}

AddressStore is an interface of the container of local Multiaddr.

type AddressStoreComponent

type AddressStoreComponent interface {
	AddressStore
	NodePublicKeyReceiver
}

AddressStoreComponent is an interface of encapsulated AddressStore and NodePublicKeyReceiver pair.

func NewAddressStore

func NewAddressStore(ps peers.Store, log *zap.Logger) (AddressStoreComponent, error)

NewAddressStore wraps peer store and returns AddressStoreComponent.

type BalanceOfParams

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

BalanceOfParams is a structure that groups the parameters for NeoFS user balance receiving operation.

func (BalanceOfParams) OwnerID

func (s BalanceOfParams) OwnerID() refs.OwnerID

OwnerID is an owner ID getter.

func (*BalanceOfParams) SetOwnerID

func (s *BalanceOfParams) SetOwnerID(v refs.OwnerID)

SetOwnerID is an owner ID setter.

type BalanceOfResult

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

BalanceOfResult is a structure that groups the values of the result of NeoFS user balance receiving operation.

func (BalanceOfResult) Amount

func (s BalanceOfResult) Amount() int64

Amount is an funds amount getter.

func (*BalanceOfResult) SetAmount

func (s *BalanceOfResult) SetAmount(v int64)

SetAmount is an funds amount setter.

type BasicACLGetter

type BasicACLGetter interface {
	GetBasicACL(context.Context, CID) (uint32, error)
}

BasicACLGetter helper provides function to return basic ACL value.

type CID

type CID = refs.CID

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

type ContainerInvolvementChecker

type ContainerInvolvementChecker interface {
	IsContainerNode(ctx context.Context, addr multiaddr.Multiaddr, cid CID, previousNetMap bool) (bool, error)
}

ContainerInvolvementChecker is an interface of container affiliation checker.

type ContainerNodesLister

type ContainerNodesLister interface {
	ContainerNodes(ctx context.Context, cid CID) ([]multiaddr.Multiaddr, error)
	ContainerNodesInfo(ctx context.Context, cid CID, prev int) ([]bootstrap.NodeInfo, error)
}

ContainerNodesLister is an interface of container placement vector builder.

type ContainerOwnerChecker

type ContainerOwnerChecker interface {
	IsContainerOwner(context.Context, CID, refs.OwnerID) (bool, error)
}

ContainerOwnerChecker checks owner of the container.

type ContainerTraverseExecutor

type ContainerTraverseExecutor interface {
	Execute(context.Context, TraverseParams)
}

ContainerTraverseExecutor is an interface of object operation executor with container traversing.

func NewContainerTraverseExecutor

func NewContainerTraverseExecutor(t transport.ObjectTransport) (ContainerTraverseExecutor, error)

NewContainerTraverseExecutor is a ContainerTraverseExecutor executor.

type DecimalsParams

type DecimalsParams struct {
}

DecimalsParams is a structure that groups the parameters for NeoFS token decimals receiving operation.

type DecimalsResult

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

DecimalsResult is a structure that groups the values of the result of NeoFS token decimals receiving operation.

func (DecimalsResult) Decimals

func (s DecimalsResult) Decimals() int64

Decimals is a decimals getter.

func (*DecimalsResult) SetDecimals

func (s *DecimalsResult) SetDecimals(v int64)

SetDecimals is a decimals setter.

type EpochReceiver

type EpochReceiver interface {
	Epoch() uint64
}

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

type GetParams

type GetParams struct {
	SelectiveParams
	Handler func(multiaddr.Multiaddr, *object.Object)
}

GetParams groups the parameters of selective object Get.

func (*GetParams) HandleResult

func (s *GetParams) HandleResult(_ context.Context, node multiaddr.Multiaddr, r interface{}, e error)

HandleResult calls Handler if error argument is nil with:

  • Multiaddr with argument value;
  • result casted to an Object pointer.

type HeadParams

type HeadParams struct {
	GetParams
	FullHeaders bool
}

HeadParams groups the parameters of selective object Head.

type LocatorParams

type LocatorParams struct {
	SelectiveContainerExecutor SelectiveContainerExecutor
	Logger                     *zap.Logger
}

LocatorParams groups the parameters of ObjectLocator constructor.

type MorphBalanceContract

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

MorphBalanceContract is a wrapper over NeoFS Balance contract client that provides an interface of manipulations with user funds.

func (MorphBalanceContract) BalanceOf

BalanceOf performs the test invocation call of balanceOf method of NeoFS Balance contract.

func (MorphBalanceContract) Decimals

Decimals performs the test invocation call of decimals method of NeoFS Balance contract.

func (*MorphBalanceContract) SetBalanceContractClient

func (s *MorphBalanceContract) SetBalanceContractClient(v StaticContractClient)

SetBalanceContractClient is a Balance contract client setter.

func (*MorphBalanceContract) SetBalanceOfMethodName

func (s *MorphBalanceContract) SetBalanceOfMethodName(v string)

SetBalanceOfMethodName is a Balance contract balanceOf method name setter.

func (*MorphBalanceContract) SetDecimalsMethodName

func (s *MorphBalanceContract) SetDecimalsMethodName(v string)

SetDecimalsMethodName is a Balance contract decimals method name setter.

type MorphContainerContract

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

MorphContainerContract is a wrapper over StaticContractClient for Container contract calls.

func (*MorphContainerContract) DeleteContainer

DeleteContainer invokes the call of Delete method of NeoFS Container contract.

func (*MorphContainerContract) GetBinaryEACL

GetBinaryEACL performs the test invocation call of GetEACL method of NeoFS Container contract.

func (*MorphContainerContract) GetContainer

GetContainer performs the test invocation call of Get method of NeoFS Container contract.

func (*MorphContainerContract) ListContainers

ListContainers performs the test invocation call of Get method of NeoFS Container contract.

If owner ID list in parameters is non-empty, bytes of first owner are attached to call.

func (*MorphContainerContract) PutBinaryEACL

PutBinaryEACL invokes the call of SetEACL method of NeoFS Container contract.

func (*MorphContainerContract) PutContainer

PutContainer invokes the call of Put method of NeoFS Container contract.

func (*MorphContainerContract) SetContainerContractClient

func (s *MorphContainerContract) SetContainerContractClient(v StaticContractClient)

SetContainerContractClient is a container contract client setter.

func (*MorphContainerContract) SetContainerDeleteMethodName

func (s *MorphContainerContract) SetContainerDeleteMethodName(v string)

SetContainerDeleteMethodName is a container contract Delete method name setter.

func (*MorphContainerContract) SetContainerGetMethodName

func (s *MorphContainerContract) SetContainerGetMethodName(v string)

SetContainerGetMethodName is a container contract Get method name setter.

func (*MorphContainerContract) SetContainerListMethodName

func (s *MorphContainerContract) SetContainerListMethodName(v string)

SetContainerListMethodName is a container contract List method name setter.

func (*MorphContainerContract) SetContainerPutMethodName

func (s *MorphContainerContract) SetContainerPutMethodName(v string)

SetContainerPutMethodName is a container contract Put method name setter.

func (*MorphContainerContract) SetEACLGetMethodName

func (s *MorphContainerContract) SetEACLGetMethodName(v string)

SetEACLGetMethodName is a container contract Get EACL method name setter.

func (*MorphContainerContract) SetEACLSetMethodName

func (s *MorphContainerContract) SetEACLSetMethodName(v string)

SetEACLSetMethodName is a container contract Set EACL method name setter.

type MorphNetmapContract

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

MorphNetmapContract is a wrapper over NeoFS Netmap contract client that provides an interface of network map manipulations.

func (*MorphNetmapContract) AddPeer

AddPeer invokes the call of AddPeer method of NeoFS Netmap contract.

func (*MorphNetmapContract) GetIRInfo

GetIRInfo performs the test invocation call of InnerRingList method of NeoFS Netmap contract.

func (*MorphNetmapContract) GetNetMap

GetNetMap performs the test invocation call of Netmap method of NeoFS Netmap contract.

func (*MorphNetmapContract) SetAddPeerMethodName

func (s *MorphNetmapContract) SetAddPeerMethodName(v string)

SetAddPeerMethodName is a Netmap contract AddPeer method name setter.

func (*MorphNetmapContract) SetIRListMethodName

func (s *MorphNetmapContract) SetIRListMethodName(v string)

SetIRListMethodName is a Netmap contract InnerRingList method name setter.

func (*MorphNetmapContract) SetNetMapMethodName

func (s *MorphNetmapContract) SetNetMapMethodName(v string)

SetNetMapMethodName is a Netmap contract Netmap method name setter.

func (*MorphNetmapContract) SetNetmapContractClient

func (s *MorphNetmapContract) SetNetmapContractClient(v StaticContractClient)

SetNetmapContractClient is a Netmap contract client setter.

func (*MorphNetmapContract) SetNewEpochMethodName

func (s *MorphNetmapContract) SetNewEpochMethodName(v string)

SetNewEpochMethodName is a Netmap contract NewEpoch method name setter.

func (*MorphNetmapContract) SetUpdateStateMethodName

func (s *MorphNetmapContract) SetUpdateStateMethodName(v string)

SetUpdateStateMethodName is a Netmap contract UpdateState method name setter.

func (*MorphNetmapContract) UpdateEpoch

func (s *MorphNetmapContract) UpdateEpoch(p UpdateEpochParams) error

UpdateEpoch invokes the call of NewEpoch method of NeoFS Netmap contract.

func (*MorphNetmapContract) UpdateState

func (s *MorphNetmapContract) UpdateState(p UpdateStateParams) error

UpdateState invokes the call of UpdateState method of NeoFS Netmap contract.

type MorphReputationContract

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

MorphReputationContract is a wrapper over NeoFS Reputation contract client that provides an interface of the storage of global trust values.

func (*MorphReputationContract) SetListMethodName

func (s *MorphReputationContract) SetListMethodName(v string)

SetListMethodName is a Reputation contract List method name setter.

func (*MorphReputationContract) SetPublicKeyStore

func (s *MorphReputationContract) SetPublicKeyStore(v peers.PublicKeyStore)

SetPublicKeyStore is a public key store setter.

func (*MorphReputationContract) SetPutMethodName

func (s *MorphReputationContract) SetPutMethodName(v string)

SetPutMethodName is a Reputation contract Put method name setter.

func (*MorphReputationContract) SetReputationContractClient

func (s *MorphReputationContract) SetReputationContractClient(v StaticContractClient)

SetReputationContractClient is a Reputation contract client setter.

type Netmap

type Netmap = netmap.NetMap

Netmap is a type alias of NetMap from netmap package.

type NodePublicKeyReceiver

type NodePublicKeyReceiver interface {
	PublicKey(multiaddr.Multiaddr) *ecdsa.PublicKey
}

NodePublicKeyReceiver is an interface of Multiaddr to PublicKey converter.

type NodeState

type NodeState int64

NodeState is a type of node states enumeration.

const (

	// StateOffline is an offline node state value.
	StateOffline NodeState
)

func (NodeState) Int64

func (s NodeState) Int64() int64

Int64 converts NodeState to int64.

type Object

type Object = object.Object

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

type ObjectContainerHandlerParams

type ObjectContainerHandlerParams struct {
	NodeLister ContainerNodesLister
	Executor   ContainerTraverseExecutor
	*zap.Logger
}

ObjectContainerHandlerParams grops the parameters of SelectiveContainerExecutor constructor.

type ObjectID

type ObjectID = refs.ObjectID

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

type ObjectPlacer

type ObjectPlacer interface {
	ContainerNodesLister
	ContainerInvolvementChecker
	GetNodes(ctx context.Context, addr Address, usePreviousNetMap bool, excl ...multiaddr.Multiaddr) ([]multiaddr.Multiaddr, error)
	Epoch() uint64
}

ObjectPlacer is an interface of placement utility.

func NewObjectPlacer

func NewObjectPlacer(pl placement.Component) (ObjectPlacer, error)

NewObjectPlacer wraps placement.Component and returns ObjectPlacer interface.

type ObjectStorage

type ObjectStorage interface {
	replication.ObjectReceptacle
	replication.ObjectSource
}

ObjectStorage is an interface of encapsulated ObjectReceptacle and ObjectSource pair.

func NewObjectStorage

func NewObjectStorage(p ObjectStorageParams) (ObjectStorage, error)

NewObjectStorage encapsulates Localstore and SelectiveContainerExecutor and returns ObjectStorage interface.

type ObjectStorageParams

type ObjectStorageParams struct {
	Localstore                 localstore.Localstore
	SelectiveContainerExecutor SelectiveContainerExecutor
	Logger                     *zap.Logger
}

ObjectStorageParams groups the parameters of ObjectStorage constructor.

type ObjectValidatorParams

type ObjectValidatorParams struct {
	AddressStore               AddressStore
	Localstore                 localstore.Localstore
	SelectiveContainerExecutor SelectiveContainerExecutor
	Logger                     *zap.Logger

	Salitor             Salitor
	SaltSize            int
	MaxPayloadRangeSize uint64
	PayloadRangeCount   int

	Verifier objutil.Verifier
}

ObjectValidatorParams groups th

type ProgressControlFlag

type ProgressControlFlag int

ProgressControlFlag is an enumeration of progress control flags.

const (

	// NextAddress is a ProgressControlFlag of to go to the next address of the object.
	NextAddress ProgressControlFlag

	// NextNode is a ProgressControlFlag of to go to the next node.
	NextNode

	// BreakProgress is a ProgressControlFlag to interrupt the execution.
	BreakProgress
)

type PutParams

type PutParams struct {
	SelectiveParams
	Object  *object.Object
	Handler func(multiaddr.Multiaddr, bool)

	CopiesNumber uint32
}

PutParams groups the parameters of selective object Put.

func (*PutParams) HandleResult

func (s *PutParams) HandleResult(_ context.Context, node multiaddr.Multiaddr, _ interface{}, e error)

HandleResult calls Handler with:

  • Multiaddr with argument value;
  • error equality to nil.

type RangeHashParams

type RangeHashParams struct {
	SelectiveParams
	Ranges  []object.Range
	Salt    []byte
	Handler func(multiaddr.Multiaddr, []hash.Hash)
}

RangeHashParams groups the parameters of selective object GetRangeHash.

func (*RangeHashParams) HandleResult

func (s *RangeHashParams) HandleResult(_ context.Context, node multiaddr.Multiaddr, r interface{}, e error)

HandleResult calls Handler if error argument is nil with:

  • Multiaddr with argument value;
  • result casted to Hash slice.

type SGID

type SGID = refs.SGID

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

type Salitor

type Salitor func(data, salt []byte) []byte

Salitor is a salting data function.

type SearchParams

type SearchParams struct {
	SelectiveParams
	SearchCID   refs.CID
	SearchQuery []byte
	Handler     func(multiaddr.Multiaddr, []refs.Address)
}

SearchParams groups the parameters of selective object Search.

func (*SearchParams) HandleResult

func (s *SearchParams) HandleResult(_ context.Context, node multiaddr.Multiaddr, r interface{}, e error)

HandleResult calls Handler if error argument is nil with:

  • Multiaddr with argument value;
  • result casted to Address slice.

type SelectiveContainerExecutor

type SelectiveContainerExecutor interface {
	Put(context.Context, *PutParams) error
	Get(context.Context, *GetParams) error
	Head(context.Context, *HeadParams) error
	Search(context.Context, *SearchParams) error
	RangeHash(context.Context, *RangeHashParams) error
}

SelectiveContainerExecutor is an interface the tool that performs object operations in container with preconditions.

func NewObjectContainerHandler

func NewObjectContainerHandler(p ObjectContainerHandlerParams) (SelectiveContainerExecutor, error)

NewObjectContainerHandler is a SelectiveContainerExecutor constructor.

type SelectiveParams

type SelectiveParams struct {
	/* Should be set to true only if service under object transport implementations is served on localhost. */
	ServeLocal bool

	/* Raw option of the request */
	Raw bool

	/* TTL for object transport. All transport operations inherit same value. */
	TTL uint32

	/* Required ID of processing container. If empty or not set, an error is returned. */
	CID

	/* List of nodes selected for processing. If not specified => nodes will be selected during. */
	Nodes []multiaddr.Multiaddr

	/* List of objects to process (overlaps query). */
	IDList []refs.ObjectID
	/* If no objects is indicated, query is used for selection. */
	Query []byte

	/*
		If function provided, it is called after every successful operation.
		True result breaks operation performing.
	*/
	Breaker func(refs.Address) ProgressControlFlag

	/* Public session token */
	Token service.SessionToken

	/* Bearer token */
	Bearer service.BearerToken

	/* Extended headers */
	ExtendedHeaders []service.ExtendedHeader
}

SelectiveParams groups the parameters of the execution of selective container operation.

type StaticContractClient

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

StaticContractClient is a wrapper over Neo:Morph client that invokes single smart contract methods with fixed fee.

func NewStaticContractClient

func NewStaticContractClient(client *goclient.Client, scHash util.Uint160, fee util.Fixed8) (StaticContractClient, error)

NewStaticContractClient initializes a new StaticContractClient.

If passed Client is nil, goclient.ErrNilClient returns.

func (StaticContractClient) Invoke

func (s StaticContractClient) Invoke(method string, args ...interface{}) error

Invoke calls Invoke method of goclient with predefined script hash and fee. Supported args types are the same as in goclient.

If Client is not initialized, goclient.ErrNilClient returns.

func (StaticContractClient) TestInvoke

func (s StaticContractClient) TestInvoke(method string, args ...interface{}) ([]sc.Parameter, error)

TestInvoke calls TestInvoke method of goclient with predefined script hash.

If Client is not initialized, goclient.ErrNilClient returns.

type StorageGroupInfoReceiverParams

type StorageGroupInfoReceiverParams struct {
	SelectiveContainerExecutor SelectiveContainerExecutor
	Logger                     *zap.Logger
}

StorageGroupInfoReceiverParams groups the parameters of storage group information receiver.

type TraverseParams

type TraverseParams struct {
	TransportInfo        transport.MetaInfo
	Handler              transport.ResultHandler
	Traverser            Traverser
	WorkerPool           WorkerPool
	ExecutionInterceptor func(context.Context, multiaddr.Multiaddr) bool
}

TraverseParams groups the parameters of container traversing.

type Traverser

type Traverser interface {
	Next(context.Context) []multiaddr.Multiaddr
}

Traverser is an interface of container traverser.

type UpdateEpochParams

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

UpdateEpochParams is a structure that groups the parameters for NeoFS epoch number updating.

func (UpdateEpochParams) Number

func (s UpdateEpochParams) Number() uint64

Number is an epoch number getter.

func (*UpdateEpochParams) SetNumber

func (s *UpdateEpochParams) SetNumber(v uint64)

SetNumber is an epoch number setter.

type UpdateStateParams

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

UpdateStateParams is a structure that groups the parameters for NeoFS node state updating.

func (UpdateStateParams) Key

func (s UpdateStateParams) Key() []byte

Key is a public key getter.

func (*UpdateStateParams) SetKey

func (s *UpdateStateParams) SetKey(v []byte)

SetKey is a public key setter.

func (*UpdateStateParams) SetState

func (s *UpdateStateParams) SetState(v NodeState)

SetState is a state setter.

func (UpdateStateParams) State

func (s UpdateStateParams) State() NodeState

State is a state getter.

type WorkerPool

type WorkerPool interface {
	Submit(func()) error
}

WorkerPool is an interface of go-routine pool

Jump to

Keyboard shortcuts

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