Documentation ¶
Index ¶
- type Node
- type Server
- func (s *Server) Delete(ctx context.Context, req *objectGRPC.DeleteRequest) (*objectGRPC.DeleteResponse, error)
- func (s *Server) Get(req *objectGRPC.GetRequest, gStream objectGRPC.ObjectService_GetServer) error
- func (s *Server) GetRange(req *objectGRPC.GetRangeRequest, ...) error
- func (s *Server) GetRangeHash(ctx context.Context, req *objectGRPC.GetRangeHashRequest) (*objectGRPC.GetRangeHashResponse, error)
- func (s *Server) Head(ctx context.Context, req *objectGRPC.HeadRequest) (*objectGRPC.HeadResponse, error)
- func (s *Server) Put(gStream objectGRPC.ObjectService_PutServer) error
- func (s *Server) Replicate(_ context.Context, req *objectGRPC.ReplicateRequest) (*objectGRPC.ReplicateResponse, error)
- func (s *Server) Search(req *objectGRPC.SearchRequest, gStream objectGRPC.ObjectService_SearchServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node interface { // 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 // IsOwnPublicKey checks whether given pubKey assigned to Node in the NeoFS // network map. IsOwnPublicKey(pubKey []byte) bool // VerifyAndStoreObject checks whether given object has correct format and, if // so, saves it into local object storage of the Node. StoreObject is called // only when the Node complies with the container's storage policy. VerifyAndStoreObject(objectsdk.Object) error }
Node represents NeoFS storage node that is served by Server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wraps NeoFS API Object service and provides gRPC Object service server interface.
func New ¶
func New(c objectSvc.ServiceServer, node Node) *Server
New creates, initializes and returns Server instance.
func (*Server) Delete ¶
func (s *Server) Delete(ctx context.Context, req *objectGRPC.DeleteRequest) (*objectGRPC.DeleteResponse, error)
Delete converts gRPC DeleteRequest message and passes it to internal Object service.
func (*Server) Get ¶
func (s *Server) Get(req *objectGRPC.GetRequest, gStream objectGRPC.ObjectService_GetServer) error
Get converts gRPC GetRequest message and server-side stream and overtakes its data to gRPC stream.
func (*Server) GetRange ¶
func (s *Server) GetRange(req *objectGRPC.GetRangeRequest, gStream objectGRPC.ObjectService_GetRangeServer) error
GetRange converts gRPC GetRangeRequest message and server-side stream and overtakes its data to gRPC stream.
func (*Server) GetRangeHash ¶
func (s *Server) GetRangeHash(ctx context.Context, req *objectGRPC.GetRangeHashRequest) (*objectGRPC.GetRangeHashResponse, error)
GetRangeHash converts gRPC GetRangeHashRequest message and passes it to internal Object service.
func (*Server) Head ¶
func (s *Server) Head(ctx context.Context, req *objectGRPC.HeadRequest) (*objectGRPC.HeadResponse, error)
Head converts gRPC HeadRequest message and passes it to internal Object service.
func (*Server) Put ¶
func (s *Server) Put(gStream objectGRPC.ObjectService_PutServer) error
Put opens internal Object service Put stream and overtakes data from gRPC stream to it.
func (*Server) Replicate ¶
func (s *Server) Replicate(_ context.Context, req *objectGRPC.ReplicateRequest) (*objectGRPC.ReplicateResponse, error)
Replicate serves neo.fs.v2.object.ObjectService/Replicate RPC.
func (*Server) Search ¶
func (s *Server) Search(req *objectGRPC.SearchRequest, gStream objectGRPC.ObjectService_SearchServer) error
Search converts gRPC SearchRequest message and server-side stream and overtakes its data to gRPC stream.