Documentation
¶
Index ¶
- type ACLInfoExtractor
- type FSChain
- type Handlers
- type MetricCollector
- type Server
- func (s *Server) Delete(ctx context.Context, req *protoobject.DeleteRequest) (*protoobject.DeleteResponse, error)
- func (s *Server) Get(req *protoobject.GetRequest, gStream protoobject.ObjectService_GetServer) error
- func (s *Server) GetRange(req *protoobject.GetRangeRequest, ...) error
- func (s *Server) GetRangeHash(ctx context.Context, req *protoobject.GetRangeHashRequest) (*protoobject.GetRangeHashResponse, error)
- func (s *Server) Head(ctx context.Context, req *protoobject.HeadRequest) (*protoobject.HeadResponse, error)
- func (s *Server) ProcessSearch(ctx context.Context, req *protoobject.SearchV2Request) ([]sdkclient.SearchResultItem, []byte, error)
- func (s *Server) Put(gStream protoobject.ObjectService_PutServer) error
- func (s *Server) Replicate(_ context.Context, req *protoobject.ReplicateRequest) (*protoobject.ReplicateResponse, error)
- func (s *Server) Search(req *protoobject.SearchRequest, gStream protoobject.ObjectService_SearchServer) error
- func (s *Server) SearchV2(ctx context.Context, req *protoobject.SearchV2Request) (*protoobject.SearchV2Response, error)
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 {
container.Source
netmap.StateDetailed
icrypto.N3ScriptRunner
// 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 Server ¶ added in v0.46.0
type Server struct {
// contains filtered or unexported fields
}
Server represents Object Service server that provides object manipulation operations including Get, Put, Head, Range, Delete, Search, and Replicate. The server enforces access control, verifies requests, and handles data storage and retrieval operations.
func New ¶ added in v0.45.0
func New(hs Handlers, magicNumber uint32, fsChain FSChain, st Storage, metaSvc *metasvc.Meta, signer ecdsa.PrivateKey, m MetricCollector, ac aclsvc.ACLChecker, rp ACLInfoExtractor, cs searchsvc.ClientConstructor) *Server
New provides protoobject.ObjectServiceServer for the given parameters.
func (*Server) Delete ¶ added in v0.46.0
func (s *Server) Delete(ctx context.Context, req *protoobject.DeleteRequest) (*protoobject.DeleteResponse, error)
func (*Server) Get ¶ added in v0.46.0
func (s *Server) Get(req *protoobject.GetRequest, gStream protoobject.ObjectService_GetServer) error
func (*Server) GetRange ¶ added in v0.46.0
func (s *Server) GetRange(req *protoobject.GetRangeRequest, gStream protoobject.ObjectService_GetRangeServer) error
func (*Server) GetRangeHash ¶ added in v0.46.0
func (s *Server) GetRangeHash(ctx context.Context, req *protoobject.GetRangeHashRequest) (*protoobject.GetRangeHashResponse, error)
GetRangeHash converts gRPC GetRangeHashRequest message and passes it to internal Object service.
func (*Server) Head ¶ added in v0.46.0
func (s *Server) Head(ctx context.Context, req *protoobject.HeadRequest) (*protoobject.HeadResponse, error)
func (*Server) ProcessSearch ¶ added in v0.46.0
func (s *Server) ProcessSearch(ctx context.Context, req *protoobject.SearchV2Request) ([]sdkclient.SearchResultItem, []byte, error)
func (*Server) Put ¶ added in v0.46.0
func (s *Server) Put(gStream protoobject.ObjectService_PutServer) error
func (*Server) Replicate ¶ added in v0.46.0
func (s *Server) Replicate(_ context.Context, req *protoobject.ReplicateRequest) (*protoobject.ReplicateResponse, error)
Replicate serves neo.fs.v2.object.ObjectService/Replicate RPC.
func (*Server) Search ¶ added in v0.46.0
func (s *Server) Search(req *protoobject.SearchRequest, gStream protoobject.ObjectService_SearchServer) error
func (*Server) SearchV2 ¶ added in v0.46.0
func (s *Server) SearchV2(ctx context.Context, req *protoobject.SearchV2Request) (*protoobject.SearchV2Response, error)
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, _ []objectcore.SearchFilter, attrs []string, cursor *objectcore.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.