Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶ added in v0.45.0
func New(hs Handlers, magicNumber uint32, fsChain FSChain, st Storage, signer ecdsa.PrivateKey, m MetricCollector, ac aclsvc.ACLChecker, rp ACLInfoExtractor, cs searchsvc.ClientConstructor) protoobject.ObjectServiceServer
New provides protoobject.ObjectServiceServer for the given parameters.
Types ¶
type ACLInfoExtractor ¶ added in v0.45.0
type ACLInfoExtractor interface {
PutRequestToInfo(*protoobject.PutRequest) (aclsvc.RequestInfo, user.ID, error)
DeleteRequestToInfo(*protoobject.DeleteRequest) (aclsvc.RequestInfo, error)
HeadRequestToInfo(*protoobject.HeadRequest) (aclsvc.RequestInfo, error)
HashRequestToInfo(*protoobject.GetRangeHashRequest) (aclsvc.RequestInfo, error)
GetRequestToInfo(*protoobject.GetRequest) (aclsvc.RequestInfo, error)
RangeRequestToInfo(*protoobject.GetRangeRequest) (aclsvc.RequestInfo, error)
SearchRequestToInfo(*protoobject.SearchRequest) (aclsvc.RequestInfo, error)
SearchV2RequestToInfo(*protoobject.SearchV2Request) (aclsvc.RequestInfo, error)
}
ACLInfoExtractor is the interface that allows to fetch data required for ACL checks from various types of grpc requests.
type FSChain ¶ added in v0.45.0
type FSChain interface {
netmap.StateDetailed
// ForEachContainerNodePublicKeyInLastTwoEpochs iterates over all nodes matching
// the referenced container's storage policy at the current and the previous
// NeoFS epochs, and passes their public keys into f. IterateContainerNodeKeys
// breaks without an error when f returns false. Keys may be repeated.
//
// Returns [apistatus.ErrContainerNotFound] if referenced container was not
// found.
ForEachContainerNodePublicKeyInLastTwoEpochs(cid.ID, func(pubKey []byte) bool) error
// ForEachContainerNode iterates over all nodes matching the referenced
// container's storage policy for now and passes their descriptors into f.
// IterateContainerNodeKeys breaks without an error when f returns false.
// Elements may be repeated.
//
// Returns [apistatus.ErrContainerNotFound] if referenced container was not
// found.
ForEachContainerNode(cnr cid.ID, f func(sdknetmap.NodeInfo) bool) error
// IsOwnPublicKey checks whether given pubKey assigned to Node in the NeoFS
// network map.
IsOwnPublicKey(pubKey []byte) bool
// LocalNodeUnderMaintenance checks whether local node is under maintenance
// according to the network map from FSChain.
LocalNodeUnderMaintenance() bool
}
FSChain provides access to the FS chain required to serve NeoFS API Object service.
type Handlers ¶ added in v0.45.0
type Handlers interface {
Get(context.Context, getsvc.Prm) error
Put(context.Context) (*putsvc.Streamer, error)
Head(context.Context, getsvc.HeadPrm) error
Search(context.Context, searchsvc.Prm) error
Delete(context.Context, deletesvc.Prm) error
GetRange(context.Context, getsvc.RangePrm) error
GetRangeHash(context.Context, getsvc.RangeHashPrm) (*getsvc.RangeHashRes, error)
}
Handlers represents storage node's internal handler Object service op payloads.
type MetricCollector ¶ added in v0.17.0
type MetricCollector interface {
// HandleOpExecResult handles measured execution results of the given op.
HandleOpExecResult(_ stat.Method, success bool, _ time.Duration)
AddPutPayload(int)
AddGetPayload(int)
}
MetricCollector tracks exec statistics for the following ops:
type Storage ¶ added in v0.45.0
type Storage interface {
// VerifyAndStoreObjectLocally checks whether given object has correct format
// and, if so, saves it in the Storage. StoreObject is called only when local
// node complies with the container's storage policy.
VerifyAndStoreObjectLocally(object.Object) error
// SearchObjects selects up to count container's objects from the given
// container matching the specified filters.
SearchObjects(_ cid.ID, _ object.SearchFilters, _ map[int]meta.ParsedIntFilter, attrs []string, cursor *meta.SearchCursor, count uint16) ([]sdkclient.SearchResultItem, []byte, error)
// contains filtered or unexported methods
}
Storage groups ops of the node's storage required to serve NeoFS API Object service.
Click to show internal directories.
Click to hide internal directories.