Evgenii Stratonikov
328d214d2d
It has caused a noticeable degradation in node. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
1035 lines
46 KiB
Go
Generated
1035 lines
46 KiB
Go
Generated
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.5.1
|
|
// - protoc v5.29.2
|
|
// source: api/object/grpc/service.proto
|
|
|
|
package object
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
// Requires gRPC-Go v1.64.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion9
|
|
|
|
const (
|
|
ObjectService_Get_FullMethodName = "/neo.fs.v2.object.ObjectService/Get"
|
|
ObjectService_Put_FullMethodName = "/neo.fs.v2.object.ObjectService/Put"
|
|
ObjectService_Delete_FullMethodName = "/neo.fs.v2.object.ObjectService/Delete"
|
|
ObjectService_Head_FullMethodName = "/neo.fs.v2.object.ObjectService/Head"
|
|
ObjectService_Search_FullMethodName = "/neo.fs.v2.object.ObjectService/Search"
|
|
ObjectService_GetRange_FullMethodName = "/neo.fs.v2.object.ObjectService/GetRange"
|
|
ObjectService_GetRangeHash_FullMethodName = "/neo.fs.v2.object.ObjectService/GetRangeHash"
|
|
ObjectService_PutSingle_FullMethodName = "/neo.fs.v2.object.ObjectService/PutSingle"
|
|
ObjectService_Patch_FullMethodName = "/neo.fs.v2.object.ObjectService/Patch"
|
|
)
|
|
|
|
// ObjectServiceClient is the client API for ObjectService service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
//
|
|
// `ObjectService` provides API for manipulating objects. Object operations do
|
|
// not affect the sidechain and are only served by nodes in p2p style.
|
|
type ObjectServiceClient interface {
|
|
// Receive full object structure, including Headers and payload. Response uses
|
|
// gRPC stream. First response message carries the object with the requested
|
|
// address. Chunk messages are parts of the object's payload if it is needed.
|
|
// All messages, except the first one, carry payload chunks. The requested
|
|
// object can be restored by concatenation of object message payload and all
|
|
// chunks keeping the receiving order.
|
|
//
|
|
// Extended headers can change `Get` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH ] \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requsted version of Network Map for object placement
|
|
// calculation.
|
|
// - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \
|
|
// (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \
|
|
// Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH`
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or the latest one
|
|
// otherwise) of Network Map to find an object until the depth limit is
|
|
// reached.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// object has been successfully read;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// read access to the object is denied;
|
|
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \
|
|
// object not found in container;
|
|
// - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \
|
|
// the requested object has been marked as deleted;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// object container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetResponse], error)
|
|
// Put the object into container. Request uses gRPC stream. First message
|
|
// SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object
|
|
// SHOULD be set. Session token SHOULD be obtained before `PUT` operation (see
|
|
// session package). Chunk messages are considered by server as a part of an
|
|
// object payload. All messages, except first one, SHOULD be payload chunks.
|
|
// Chunk messages SHOULD be sent in the direct order of fragmentation.
|
|
//
|
|
// Extended headers can change `Put` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requsted version of Network Map for object placement
|
|
// calculation.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// object has been successfully saved in the container;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// write access to the container is denied;
|
|
// - **LOCKED** (2050, SECTION_OBJECT): \
|
|
// placement of an object of type TOMBSTONE that includes at least one
|
|
// locked object is prohibited;
|
|
// - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \
|
|
// placement of an object of type LOCK that includes at least one object of
|
|
// type other than REGULAR is prohibited;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// object storage container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \
|
|
// (for trusted object preparation) session private key does not exist or
|
|
// has
|
|
//
|
|
// been deleted;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
Put(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[PutRequest, PutResponse], error)
|
|
// Delete the object from a container. There is no immediate removal
|
|
// guarantee. Object will be marked for removal and deleted eventually.
|
|
//
|
|
// Extended headers can change `Delete` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH ] \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requested version of Network Map for object placement
|
|
// calculation.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// object has been successfully marked to be removed from the container;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// delete access to the object is denied;
|
|
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \
|
|
// the object could not be deleted because it has not been \
|
|
// found within the container;
|
|
// - **LOCKED** (2050, SECTION_OBJECT): \
|
|
// deleting a locked object is prohibited;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// object container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
|
|
// Returns the object Headers without data payload. By default full header is
|
|
// returned. If `main_only` request field is set, the short header with only
|
|
// the very minimal information will be returned instead.
|
|
//
|
|
// Extended headers can change `Head` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH ] \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requested version of Network Map for object placement
|
|
// calculation.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// object header has been successfully read;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// access to operation HEAD of the object is denied;
|
|
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \
|
|
// object not found in container;
|
|
// - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \
|
|
// the requested object has been marked as deleted;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// object container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error)
|
|
// Search objects in container. Search query allows to match by Object
|
|
// Header's filed values. Please see the corresponding FrostFS Technical
|
|
// Specification section for more details.
|
|
//
|
|
// Extended headers can change `Search` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH ] \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requested version of Network Map for object placement
|
|
// calculation.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// objects have been successfully selected;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// access to operation SEARCH of the object is denied;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// search container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SearchResponse], error)
|
|
// Get byte range of data payload. Range is set as an (offset, length) tuple.
|
|
// Like in `Get` method, the response uses gRPC stream. Requested range can be
|
|
// restored by concatenation of all received payload chunks keeping the
|
|
// receiving order.
|
|
//
|
|
// Extended headers can change `GetRange` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH ] \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requested version of Network Map for object placement
|
|
// calculation.
|
|
// - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \
|
|
// (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \
|
|
// Will try older versions of Network Map to find an object until the depth
|
|
// limit is reached.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// data range of the object payload has been successfully read;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// access to operation RANGE of the object is denied;
|
|
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \
|
|
// object not found in container;
|
|
// - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \
|
|
// the requested object has been marked as deleted.
|
|
// - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \
|
|
// the requested range is out of bounds;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// object container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetRangeResponse], error)
|
|
// Returns homomorphic or regular hash of object's payload range after
|
|
// applying XOR operation with the provided `salt`. Ranges are set of (offset,
|
|
// length) tuples. Hashes order in response corresponds to the ranges order in
|
|
// the request. Note that hash is calculated for XORed data.
|
|
//
|
|
// Extended headers can change `GetRangeHash` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH ] \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requested version of Network Map for object placement
|
|
// calculation.
|
|
// - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \
|
|
// (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \
|
|
// Will try older versions of Network Map to find an object until the depth
|
|
// limit is reached.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// data range of the object payload has been successfully hashed;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// access to operation RANGEHASH of the object is denied;
|
|
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \
|
|
// object not found in container;
|
|
// - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \
|
|
// the requested range is out of bounds;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// object container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
GetRangeHash(ctx context.Context, in *GetRangeHashRequest, opts ...grpc.CallOption) (*GetRangeHashResponse, error)
|
|
// Put the prepared object into container.
|
|
// `ContainerID`, `ObjectID`, `OwnerID`, `PayloadHash` and `PayloadLength` of
|
|
// an object MUST be set.
|
|
//
|
|
// Extended headers can change `Put` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requested version of Network Map for object placement
|
|
// calculation.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// object has been successfully saved in the container;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// write access to the container is denied;
|
|
// - **LOCKED** (2050, SECTION_OBJECT): \
|
|
// placement of an object of type TOMBSTONE that includes at least one
|
|
// locked object is prohibited;
|
|
// - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \
|
|
// placement of an object of type LOCK that includes at least one object of
|
|
// type other than REGULAR is prohibited;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// object storage container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \
|
|
// (for trusted object preparation) session private key does not exist or
|
|
// has
|
|
//
|
|
// been deleted;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
PutSingle(ctx context.Context, in *PutSingleRequest, opts ...grpc.CallOption) (*PutSingleResponse, error)
|
|
// Patch the object. Request uses gRPC stream. First message must set
|
|
// the address of the object that is going to get patched. If the object's
|
|
// attributes are patched, then these attrubutes must be set only within the
|
|
// first stream message.
|
|
//
|
|
// If the patch request is performed by NOT the object's owner but if the
|
|
// actor has the permission to perform the patch, then `OwnerID` of the object
|
|
// is changed. In this case the object's owner loses the object's ownership
|
|
// after the patch request is successfully done.
|
|
//
|
|
// As objects are content-addressable the patching causes new object ID
|
|
// generation for the patched object. This object id is set witihn
|
|
// `PatchResponse`. But the object id may remain unchanged in such cases:
|
|
// 1. The chunk of the applying patch contains the same value as the object's
|
|
// payload within the same range;
|
|
// 2. The patch that reverts the changes applied by preceding patch;
|
|
// 3. The application of the same patches for the object a few times.
|
|
//
|
|
// Extended headers can change `Patch` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requsted version of Network Map for object placement
|
|
// calculation.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// object has been successfully patched and saved in the container;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// write access to the container is denied;
|
|
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \
|
|
// object not found in container;
|
|
// - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \
|
|
// the requested object has been marked as deleted.
|
|
// - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \
|
|
// the requested range is out of bounds;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// object storage container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \
|
|
// (for trusted object preparation) session private key does not exist or
|
|
// has been deleted;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
Patch(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[PatchRequest, PatchResponse], error)
|
|
}
|
|
|
|
type objectServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewObjectServiceClient(cc grpc.ClientConnInterface) ObjectServiceClient {
|
|
return &objectServiceClient{cc}
|
|
}
|
|
|
|
func (c *objectServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetResponse], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[0], ObjectService_Get_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[GetRequest, GetResponse]{ClientStream: stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ObjectService_GetClient = grpc.ServerStreamingClient[GetResponse]
|
|
|
|
func (c *objectServiceClient) Put(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[PutRequest, PutResponse], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[1], ObjectService_Put_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[PutRequest, PutResponse]{ClientStream: stream}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ObjectService_PutClient = grpc.ClientStreamingClient[PutRequest, PutResponse]
|
|
|
|
func (c *objectServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(DeleteResponse)
|
|
err := c.cc.Invoke(ctx, ObjectService_Delete_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *objectServiceClient) Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(HeadResponse)
|
|
err := c.cc.Invoke(ctx, ObjectService_Head_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *objectServiceClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SearchResponse], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[2], ObjectService_Search_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[SearchRequest, SearchResponse]{ClientStream: stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ObjectService_SearchClient = grpc.ServerStreamingClient[SearchResponse]
|
|
|
|
func (c *objectServiceClient) GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetRangeResponse], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[3], ObjectService_GetRange_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[GetRangeRequest, GetRangeResponse]{ClientStream: stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ObjectService_GetRangeClient = grpc.ServerStreamingClient[GetRangeResponse]
|
|
|
|
func (c *objectServiceClient) GetRangeHash(ctx context.Context, in *GetRangeHashRequest, opts ...grpc.CallOption) (*GetRangeHashResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(GetRangeHashResponse)
|
|
err := c.cc.Invoke(ctx, ObjectService_GetRangeHash_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *objectServiceClient) PutSingle(ctx context.Context, in *PutSingleRequest, opts ...grpc.CallOption) (*PutSingleResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(PutSingleResponse)
|
|
err := c.cc.Invoke(ctx, ObjectService_PutSingle_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *objectServiceClient) Patch(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[PatchRequest, PatchResponse], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[4], ObjectService_Patch_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[PatchRequest, PatchResponse]{ClientStream: stream}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ObjectService_PatchClient = grpc.ClientStreamingClient[PatchRequest, PatchResponse]
|
|
|
|
// ObjectServiceServer is the server API for ObjectService service.
|
|
// All implementations should embed UnimplementedObjectServiceServer
|
|
// for forward compatibility.
|
|
//
|
|
// `ObjectService` provides API for manipulating objects. Object operations do
|
|
// not affect the sidechain and are only served by nodes in p2p style.
|
|
type ObjectServiceServer interface {
|
|
// Receive full object structure, including Headers and payload. Response uses
|
|
// gRPC stream. First response message carries the object with the requested
|
|
// address. Chunk messages are parts of the object's payload if it is needed.
|
|
// All messages, except the first one, carry payload chunks. The requested
|
|
// object can be restored by concatenation of object message payload and all
|
|
// chunks keeping the receiving order.
|
|
//
|
|
// Extended headers can change `Get` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH ] \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requsted version of Network Map for object placement
|
|
// calculation.
|
|
// - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \
|
|
// (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \
|
|
// Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH`
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or the latest one
|
|
// otherwise) of Network Map to find an object until the depth limit is
|
|
// reached.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// object has been successfully read;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// read access to the object is denied;
|
|
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \
|
|
// object not found in container;
|
|
// - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \
|
|
// the requested object has been marked as deleted;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// object container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
Get(*GetRequest, grpc.ServerStreamingServer[GetResponse]) error
|
|
// Put the object into container. Request uses gRPC stream. First message
|
|
// SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object
|
|
// SHOULD be set. Session token SHOULD be obtained before `PUT` operation (see
|
|
// session package). Chunk messages are considered by server as a part of an
|
|
// object payload. All messages, except first one, SHOULD be payload chunks.
|
|
// Chunk messages SHOULD be sent in the direct order of fragmentation.
|
|
//
|
|
// Extended headers can change `Put` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requsted version of Network Map for object placement
|
|
// calculation.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// object has been successfully saved in the container;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// write access to the container is denied;
|
|
// - **LOCKED** (2050, SECTION_OBJECT): \
|
|
// placement of an object of type TOMBSTONE that includes at least one
|
|
// locked object is prohibited;
|
|
// - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \
|
|
// placement of an object of type LOCK that includes at least one object of
|
|
// type other than REGULAR is prohibited;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// object storage container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \
|
|
// (for trusted object preparation) session private key does not exist or
|
|
// has
|
|
//
|
|
// been deleted;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
Put(grpc.ClientStreamingServer[PutRequest, PutResponse]) error
|
|
// Delete the object from a container. There is no immediate removal
|
|
// guarantee. Object will be marked for removal and deleted eventually.
|
|
//
|
|
// Extended headers can change `Delete` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH ] \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requested version of Network Map for object placement
|
|
// calculation.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// object has been successfully marked to be removed from the container;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// delete access to the object is denied;
|
|
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \
|
|
// the object could not be deleted because it has not been \
|
|
// found within the container;
|
|
// - **LOCKED** (2050, SECTION_OBJECT): \
|
|
// deleting a locked object is prohibited;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// object container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
|
|
// Returns the object Headers without data payload. By default full header is
|
|
// returned. If `main_only` request field is set, the short header with only
|
|
// the very minimal information will be returned instead.
|
|
//
|
|
// Extended headers can change `Head` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH ] \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requested version of Network Map for object placement
|
|
// calculation.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// object header has been successfully read;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// access to operation HEAD of the object is denied;
|
|
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \
|
|
// object not found in container;
|
|
// - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \
|
|
// the requested object has been marked as deleted;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// object container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
Head(context.Context, *HeadRequest) (*HeadResponse, error)
|
|
// Search objects in container. Search query allows to match by Object
|
|
// Header's filed values. Please see the corresponding FrostFS Technical
|
|
// Specification section for more details.
|
|
//
|
|
// Extended headers can change `Search` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH ] \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requested version of Network Map for object placement
|
|
// calculation.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// objects have been successfully selected;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// access to operation SEARCH of the object is denied;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// search container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
Search(*SearchRequest, grpc.ServerStreamingServer[SearchResponse]) error
|
|
// Get byte range of data payload. Range is set as an (offset, length) tuple.
|
|
// Like in `Get` method, the response uses gRPC stream. Requested range can be
|
|
// restored by concatenation of all received payload chunks keeping the
|
|
// receiving order.
|
|
//
|
|
// Extended headers can change `GetRange` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH ] \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requested version of Network Map for object placement
|
|
// calculation.
|
|
// - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \
|
|
// (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \
|
|
// Will try older versions of Network Map to find an object until the depth
|
|
// limit is reached.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// data range of the object payload has been successfully read;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// access to operation RANGE of the object is denied;
|
|
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \
|
|
// object not found in container;
|
|
// - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \
|
|
// the requested object has been marked as deleted.
|
|
// - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \
|
|
// the requested range is out of bounds;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// object container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
GetRange(*GetRangeRequest, grpc.ServerStreamingServer[GetRangeResponse]) error
|
|
// Returns homomorphic or regular hash of object's payload range after
|
|
// applying XOR operation with the provided `salt`. Ranges are set of (offset,
|
|
// length) tuples. Hashes order in response corresponds to the ranges order in
|
|
// the request. Note that hash is calculated for XORed data.
|
|
//
|
|
// Extended headers can change `GetRangeHash` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH ] \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requested version of Network Map for object placement
|
|
// calculation.
|
|
// - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \
|
|
// (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \
|
|
// Will try older versions of Network Map to find an object until the depth
|
|
// limit is reached.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// data range of the object payload has been successfully hashed;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// access to operation RANGEHASH of the object is denied;
|
|
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \
|
|
// object not found in container;
|
|
// - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \
|
|
// the requested range is out of bounds;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// object container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
GetRangeHash(context.Context, *GetRangeHashRequest) (*GetRangeHashResponse, error)
|
|
// Put the prepared object into container.
|
|
// `ContainerID`, `ObjectID`, `OwnerID`, `PayloadHash` and `PayloadLength` of
|
|
// an object MUST be set.
|
|
//
|
|
// Extended headers can change `Put` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requested version of Network Map for object placement
|
|
// calculation.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// object has been successfully saved in the container;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// write access to the container is denied;
|
|
// - **LOCKED** (2050, SECTION_OBJECT): \
|
|
// placement of an object of type TOMBSTONE that includes at least one
|
|
// locked object is prohibited;
|
|
// - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \
|
|
// placement of an object of type LOCK that includes at least one object of
|
|
// type other than REGULAR is prohibited;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// object storage container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \
|
|
// (for trusted object preparation) session private key does not exist or
|
|
// has
|
|
//
|
|
// been deleted;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
PutSingle(context.Context, *PutSingleRequest) (*PutSingleResponse, error)
|
|
// Patch the object. Request uses gRPC stream. First message must set
|
|
// the address of the object that is going to get patched. If the object's
|
|
// attributes are patched, then these attrubutes must be set only within the
|
|
// first stream message.
|
|
//
|
|
// If the patch request is performed by NOT the object's owner but if the
|
|
// actor has the permission to perform the patch, then `OwnerID` of the object
|
|
// is changed. In this case the object's owner loses the object's ownership
|
|
// after the patch request is successfully done.
|
|
//
|
|
// As objects are content-addressable the patching causes new object ID
|
|
// generation for the patched object. This object id is set witihn
|
|
// `PatchResponse`. But the object id may remain unchanged in such cases:
|
|
// 1. The chunk of the applying patch contains the same value as the object's
|
|
// payload within the same range;
|
|
// 2. The patch that reverts the changes applied by preceding patch;
|
|
// 3. The application of the same patches for the object a few times.
|
|
//
|
|
// Extended headers can change `Patch` behaviour:
|
|
// - [ __SYSTEM__NETMAP_EPOCH \
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
|
// Will use the requsted version of Network Map for object placement
|
|
// calculation.
|
|
//
|
|
// Please refer to detailed `XHeader` description.
|
|
//
|
|
// Statuses:
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
// object has been successfully patched and saved in the container;
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
|
// write access to the container is denied;
|
|
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \
|
|
// object not found in container;
|
|
// - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \
|
|
// the requested object has been marked as deleted.
|
|
// - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \
|
|
// the requested range is out of bounds;
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
|
// object storage container not found;
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
|
// access to container is denied;
|
|
// - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \
|
|
// (for trusted object preparation) session private key does not exist or
|
|
// has been deleted;
|
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
|
// provided session token has expired.
|
|
Patch(grpc.ClientStreamingServer[PatchRequest, PatchResponse]) error
|
|
}
|
|
|
|
// UnimplementedObjectServiceServer should be embedded to have
|
|
// forward compatible implementations.
|
|
//
|
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
// pointer dereference when methods are called.
|
|
type UnimplementedObjectServiceServer struct{}
|
|
|
|
func (UnimplementedObjectServiceServer) Get(*GetRequest, grpc.ServerStreamingServer[GetResponse]) error {
|
|
return status.Errorf(codes.Unimplemented, "method Get not implemented")
|
|
}
|
|
func (UnimplementedObjectServiceServer) Put(grpc.ClientStreamingServer[PutRequest, PutResponse]) error {
|
|
return status.Errorf(codes.Unimplemented, "method Put not implemented")
|
|
}
|
|
func (UnimplementedObjectServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
|
}
|
|
func (UnimplementedObjectServiceServer) Head(context.Context, *HeadRequest) (*HeadResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Head not implemented")
|
|
}
|
|
func (UnimplementedObjectServiceServer) Search(*SearchRequest, grpc.ServerStreamingServer[SearchResponse]) error {
|
|
return status.Errorf(codes.Unimplemented, "method Search not implemented")
|
|
}
|
|
func (UnimplementedObjectServiceServer) GetRange(*GetRangeRequest, grpc.ServerStreamingServer[GetRangeResponse]) error {
|
|
return status.Errorf(codes.Unimplemented, "method GetRange not implemented")
|
|
}
|
|
func (UnimplementedObjectServiceServer) GetRangeHash(context.Context, *GetRangeHashRequest) (*GetRangeHashResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetRangeHash not implemented")
|
|
}
|
|
func (UnimplementedObjectServiceServer) PutSingle(context.Context, *PutSingleRequest) (*PutSingleResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method PutSingle not implemented")
|
|
}
|
|
func (UnimplementedObjectServiceServer) Patch(grpc.ClientStreamingServer[PatchRequest, PatchResponse]) error {
|
|
return status.Errorf(codes.Unimplemented, "method Patch not implemented")
|
|
}
|
|
func (UnimplementedObjectServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeObjectServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to ObjectServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeObjectServiceServer interface {
|
|
mustEmbedUnimplementedObjectServiceServer()
|
|
}
|
|
|
|
func RegisterObjectServiceServer(s grpc.ServiceRegistrar, srv ObjectServiceServer) {
|
|
// If the following call pancis, it indicates UnimplementedObjectServiceServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&ObjectService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _ObjectService_Get_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(GetRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(ObjectServiceServer).Get(m, &grpc.GenericServerStream[GetRequest, GetResponse]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ObjectService_GetServer = grpc.ServerStreamingServer[GetResponse]
|
|
|
|
func _ObjectService_Put_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(ObjectServiceServer).Put(&grpc.GenericServerStream[PutRequest, PutResponse]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ObjectService_PutServer = grpc.ClientStreamingServer[PutRequest, PutResponse]
|
|
|
|
func _ObjectService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ObjectServiceServer).Delete(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ObjectService_Delete_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ObjectServiceServer).Delete(ctx, req.(*DeleteRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ObjectService_Head_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(HeadRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ObjectServiceServer).Head(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ObjectService_Head_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ObjectServiceServer).Head(ctx, req.(*HeadRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ObjectService_Search_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(SearchRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(ObjectServiceServer).Search(m, &grpc.GenericServerStream[SearchRequest, SearchResponse]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ObjectService_SearchServer = grpc.ServerStreamingServer[SearchResponse]
|
|
|
|
func _ObjectService_GetRange_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(GetRangeRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(ObjectServiceServer).GetRange(m, &grpc.GenericServerStream[GetRangeRequest, GetRangeResponse]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ObjectService_GetRangeServer = grpc.ServerStreamingServer[GetRangeResponse]
|
|
|
|
func _ObjectService_GetRangeHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetRangeHashRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ObjectServiceServer).GetRangeHash(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ObjectService_GetRangeHash_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ObjectServiceServer).GetRangeHash(ctx, req.(*GetRangeHashRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ObjectService_PutSingle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(PutSingleRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ObjectServiceServer).PutSingle(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ObjectService_PutSingle_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ObjectServiceServer).PutSingle(ctx, req.(*PutSingleRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ObjectService_Patch_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(ObjectServiceServer).Patch(&grpc.GenericServerStream[PatchRequest, PatchResponse]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ObjectService_PatchServer = grpc.ClientStreamingServer[PatchRequest, PatchResponse]
|
|
|
|
// ObjectService_ServiceDesc is the grpc.ServiceDesc for ObjectService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var ObjectService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "neo.fs.v2.object.ObjectService",
|
|
HandlerType: (*ObjectServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Delete",
|
|
Handler: _ObjectService_Delete_Handler,
|
|
},
|
|
{
|
|
MethodName: "Head",
|
|
Handler: _ObjectService_Head_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetRangeHash",
|
|
Handler: _ObjectService_GetRangeHash_Handler,
|
|
},
|
|
{
|
|
MethodName: "PutSingle",
|
|
Handler: _ObjectService_PutSingle_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Get",
|
|
Handler: _ObjectService_Get_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
{
|
|
StreamName: "Put",
|
|
Handler: _ObjectService_Put_Handler,
|
|
ClientStreams: true,
|
|
},
|
|
{
|
|
StreamName: "Search",
|
|
Handler: _ObjectService_Search_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
{
|
|
StreamName: "GetRange",
|
|
Handler: _ObjectService_GetRange_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
{
|
|
StreamName: "Patch",
|
|
Handler: _ObjectService_Patch_Handler,
|
|
ClientStreams: true,
|
|
},
|
|
},
|
|
Metadata: "api/object/grpc/service.proto",
|
|
}
|