2022-04-22 13:30:20 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
2022-09-05 13:46:56 +00:00
// - protoc v3.21.4
2022-04-22 13:30:20 +00:00
// source: pkg/services/tree/service.proto
package tree
import (
context "context"
2022-09-14 07:59:08 +00:00
2022-04-22 13:30:20 +00:00
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.32.0 or later.
const _ = grpc . SupportPackageIsVersion7
// TreeServiceClient is the client API for TreeService 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.
type TreeServiceClient interface {
// Add adds new node to the tree. Invoked by a client.
Add ( ctx context . Context , in * AddRequest , opts ... grpc . CallOption ) ( * AddResponse , error )
// AddByPath adds new node to the tree by path. Invoked by a client.
AddByPath ( ctx context . Context , in * AddByPathRequest , opts ... grpc . CallOption ) ( * AddByPathResponse , error )
// Remove removes node from the tree. Invoked by a client.
Remove ( ctx context . Context , in * RemoveRequest , opts ... grpc . CallOption ) ( * RemoveResponse , error )
// Move moves node from one parent to another. Invoked by a client.
Move ( ctx context . Context , in * MoveRequest , opts ... grpc . CallOption ) ( * MoveResponse , error )
// GetNodeByPath returns list of IDs corresponding to a specific filepath.
GetNodeByPath ( ctx context . Context , in * GetNodeByPathRequest , opts ... grpc . CallOption ) ( * GetNodeByPathResponse , error )
// GetSubTree returns tree corresponding to a specific node.
2022-04-29 10:06:10 +00:00
GetSubTree ( ctx context . Context , in * GetSubTreeRequest , opts ... grpc . CallOption ) ( TreeService_GetSubTreeClient , error )
2022-04-22 13:30:20 +00:00
// Apply pushes log operation from another node to the current.
// The request must be signed by a container node.
Apply ( ctx context . Context , in * ApplyRequest , opts ... grpc . CallOption ) ( * ApplyResponse , error )
2022-09-05 13:46:56 +00:00
// GetOpLog returns a stream of logged operations starting from some height.
2022-05-11 13:29:04 +00:00
GetOpLog ( ctx context . Context , in * GetOpLogRequest , opts ... grpc . CallOption ) ( TreeService_GetOpLogClient , error )
2022-04-22 13:30:20 +00:00
}
type treeServiceClient struct {
cc grpc . ClientConnInterface
}
func NewTreeServiceClient ( cc grpc . ClientConnInterface ) TreeServiceClient {
return & treeServiceClient { cc }
}
func ( c * treeServiceClient ) Add ( ctx context . Context , in * AddRequest , opts ... grpc . CallOption ) ( * AddResponse , error ) {
out := new ( AddResponse )
err := c . cc . Invoke ( ctx , "/tree.TreeService/Add" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * treeServiceClient ) AddByPath ( ctx context . Context , in * AddByPathRequest , opts ... grpc . CallOption ) ( * AddByPathResponse , error ) {
out := new ( AddByPathResponse )
err := c . cc . Invoke ( ctx , "/tree.TreeService/AddByPath" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * treeServiceClient ) Remove ( ctx context . Context , in * RemoveRequest , opts ... grpc . CallOption ) ( * RemoveResponse , error ) {
out := new ( RemoveResponse )
err := c . cc . Invoke ( ctx , "/tree.TreeService/Remove" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * treeServiceClient ) Move ( ctx context . Context , in * MoveRequest , opts ... grpc . CallOption ) ( * MoveResponse , error ) {
out := new ( MoveResponse )
err := c . cc . Invoke ( ctx , "/tree.TreeService/Move" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * treeServiceClient ) GetNodeByPath ( ctx context . Context , in * GetNodeByPathRequest , opts ... grpc . CallOption ) ( * GetNodeByPathResponse , error ) {
out := new ( GetNodeByPathResponse )
err := c . cc . Invoke ( ctx , "/tree.TreeService/GetNodeByPath" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2022-04-29 10:06:10 +00:00
func ( c * treeServiceClient ) GetSubTree ( ctx context . Context , in * GetSubTreeRequest , opts ... grpc . CallOption ) ( TreeService_GetSubTreeClient , error ) {
stream , err := c . cc . NewStream ( ctx , & TreeService_ServiceDesc . Streams [ 0 ] , "/tree.TreeService/GetSubTree" , opts ... )
2022-04-22 13:30:20 +00:00
if err != nil {
return nil , err
}
2022-04-29 10:06:10 +00:00
x := & treeServiceGetSubTreeClient { 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
}
type TreeService_GetSubTreeClient interface {
Recv ( ) ( * GetSubTreeResponse , error )
grpc . ClientStream
}
type treeServiceGetSubTreeClient struct {
grpc . ClientStream
}
func ( x * treeServiceGetSubTreeClient ) Recv ( ) ( * GetSubTreeResponse , error ) {
m := new ( GetSubTreeResponse )
if err := x . ClientStream . RecvMsg ( m ) ; err != nil {
return nil , err
}
return m , nil
2022-04-22 13:30:20 +00:00
}
func ( c * treeServiceClient ) Apply ( ctx context . Context , in * ApplyRequest , opts ... grpc . CallOption ) ( * ApplyResponse , error ) {
out := new ( ApplyResponse )
err := c . cc . Invoke ( ctx , "/tree.TreeService/Apply" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2022-05-11 13:29:04 +00:00
func ( c * treeServiceClient ) GetOpLog ( ctx context . Context , in * GetOpLogRequest , opts ... grpc . CallOption ) ( TreeService_GetOpLogClient , error ) {
stream , err := c . cc . NewStream ( ctx , & TreeService_ServiceDesc . Streams [ 1 ] , "/tree.TreeService/GetOpLog" , opts ... )
if err != nil {
return nil , err
}
x := & treeServiceGetOpLogClient { 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
}
type TreeService_GetOpLogClient interface {
Recv ( ) ( * GetOpLogResponse , error )
grpc . ClientStream
}
type treeServiceGetOpLogClient struct {
grpc . ClientStream
}
func ( x * treeServiceGetOpLogClient ) Recv ( ) ( * GetOpLogResponse , error ) {
m := new ( GetOpLogResponse )
if err := x . ClientStream . RecvMsg ( m ) ; err != nil {
return nil , err
}
return m , nil
}
2022-04-22 13:30:20 +00:00
// TreeServiceServer is the server API for TreeService service.
// All implementations should embed UnimplementedTreeServiceServer
// for forward compatibility
type TreeServiceServer interface {
// Add adds new node to the tree. Invoked by a client.
Add ( context . Context , * AddRequest ) ( * AddResponse , error )
// AddByPath adds new node to the tree by path. Invoked by a client.
AddByPath ( context . Context , * AddByPathRequest ) ( * AddByPathResponse , error )
// Remove removes node from the tree. Invoked by a client.
Remove ( context . Context , * RemoveRequest ) ( * RemoveResponse , error )
// Move moves node from one parent to another. Invoked by a client.
Move ( context . Context , * MoveRequest ) ( * MoveResponse , error )
// GetNodeByPath returns list of IDs corresponding to a specific filepath.
GetNodeByPath ( context . Context , * GetNodeByPathRequest ) ( * GetNodeByPathResponse , error )
// GetSubTree returns tree corresponding to a specific node.
2022-04-29 10:06:10 +00:00
GetSubTree ( * GetSubTreeRequest , TreeService_GetSubTreeServer ) error
2022-04-22 13:30:20 +00:00
// Apply pushes log operation from another node to the current.
// The request must be signed by a container node.
Apply ( context . Context , * ApplyRequest ) ( * ApplyResponse , error )
2022-09-05 13:46:56 +00:00
// GetOpLog returns a stream of logged operations starting from some height.
2022-05-11 13:29:04 +00:00
GetOpLog ( * GetOpLogRequest , TreeService_GetOpLogServer ) error
2022-04-22 13:30:20 +00:00
}
// UnimplementedTreeServiceServer should be embedded to have forward compatible implementations.
type UnimplementedTreeServiceServer struct {
}
func ( UnimplementedTreeServiceServer ) Add ( context . Context , * AddRequest ) ( * AddResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method Add not implemented" )
}
func ( UnimplementedTreeServiceServer ) AddByPath ( context . Context , * AddByPathRequest ) ( * AddByPathResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method AddByPath not implemented" )
}
func ( UnimplementedTreeServiceServer ) Remove ( context . Context , * RemoveRequest ) ( * RemoveResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method Remove not implemented" )
}
func ( UnimplementedTreeServiceServer ) Move ( context . Context , * MoveRequest ) ( * MoveResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method Move not implemented" )
}
func ( UnimplementedTreeServiceServer ) GetNodeByPath ( context . Context , * GetNodeByPathRequest ) ( * GetNodeByPathResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method GetNodeByPath not implemented" )
}
2022-04-29 10:06:10 +00:00
func ( UnimplementedTreeServiceServer ) GetSubTree ( * GetSubTreeRequest , TreeService_GetSubTreeServer ) error {
return status . Errorf ( codes . Unimplemented , "method GetSubTree not implemented" )
2022-04-22 13:30:20 +00:00
}
func ( UnimplementedTreeServiceServer ) Apply ( context . Context , * ApplyRequest ) ( * ApplyResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method Apply not implemented" )
}
2022-05-11 13:29:04 +00:00
func ( UnimplementedTreeServiceServer ) GetOpLog ( * GetOpLogRequest , TreeService_GetOpLogServer ) error {
return status . Errorf ( codes . Unimplemented , "method GetOpLog not implemented" )
}
2022-04-22 13:30:20 +00:00
// UnsafeTreeServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to TreeServiceServer will
// result in compilation errors.
type UnsafeTreeServiceServer interface {
mustEmbedUnimplementedTreeServiceServer ( )
}
func RegisterTreeServiceServer ( s grpc . ServiceRegistrar , srv TreeServiceServer ) {
s . RegisterService ( & TreeService_ServiceDesc , srv )
}
func _TreeService_Add_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( AddRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( TreeServiceServer ) . Add ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/tree.TreeService/Add" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( TreeServiceServer ) . Add ( ctx , req . ( * AddRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _TreeService_AddByPath_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( AddByPathRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( TreeServiceServer ) . AddByPath ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/tree.TreeService/AddByPath" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( TreeServiceServer ) . AddByPath ( ctx , req . ( * AddByPathRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _TreeService_Remove_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( RemoveRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( TreeServiceServer ) . Remove ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/tree.TreeService/Remove" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( TreeServiceServer ) . Remove ( ctx , req . ( * RemoveRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _TreeService_Move_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( MoveRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( TreeServiceServer ) . Move ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/tree.TreeService/Move" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( TreeServiceServer ) . Move ( ctx , req . ( * MoveRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _TreeService_GetNodeByPath_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( GetNodeByPathRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( TreeServiceServer ) . GetNodeByPath ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/tree.TreeService/GetNodeByPath" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( TreeServiceServer ) . GetNodeByPath ( ctx , req . ( * GetNodeByPathRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2022-04-29 10:06:10 +00:00
func _TreeService_GetSubTree_Handler ( srv interface { } , stream grpc . ServerStream ) error {
m := new ( GetSubTreeRequest )
if err := stream . RecvMsg ( m ) ; err != nil {
return err
2022-04-22 13:30:20 +00:00
}
2022-04-29 10:06:10 +00:00
return srv . ( TreeServiceServer ) . GetSubTree ( m , & treeServiceGetSubTreeServer { stream } )
}
type TreeService_GetSubTreeServer interface {
Send ( * GetSubTreeResponse ) error
grpc . ServerStream
}
type treeServiceGetSubTreeServer struct {
grpc . ServerStream
}
func ( x * treeServiceGetSubTreeServer ) Send ( m * GetSubTreeResponse ) error {
return x . ServerStream . SendMsg ( m )
2022-04-22 13:30:20 +00:00
}
func _TreeService_Apply_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( ApplyRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( TreeServiceServer ) . Apply ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/tree.TreeService/Apply" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( TreeServiceServer ) . Apply ( ctx , req . ( * ApplyRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2022-05-11 13:29:04 +00:00
func _TreeService_GetOpLog_Handler ( srv interface { } , stream grpc . ServerStream ) error {
m := new ( GetOpLogRequest )
if err := stream . RecvMsg ( m ) ; err != nil {
return err
}
return srv . ( TreeServiceServer ) . GetOpLog ( m , & treeServiceGetOpLogServer { stream } )
}
type TreeService_GetOpLogServer interface {
Send ( * GetOpLogResponse ) error
grpc . ServerStream
}
type treeServiceGetOpLogServer struct {
grpc . ServerStream
}
func ( x * treeServiceGetOpLogServer ) Send ( m * GetOpLogResponse ) error {
return x . ServerStream . SendMsg ( m )
}
2022-04-22 13:30:20 +00:00
// TreeService_ServiceDesc is the grpc.ServiceDesc for TreeService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var TreeService_ServiceDesc = grpc . ServiceDesc {
ServiceName : "tree.TreeService" ,
HandlerType : ( * TreeServiceServer ) ( nil ) ,
Methods : [ ] grpc . MethodDesc {
{
MethodName : "Add" ,
Handler : _TreeService_Add_Handler ,
} ,
{
MethodName : "AddByPath" ,
Handler : _TreeService_AddByPath_Handler ,
} ,
{
MethodName : "Remove" ,
Handler : _TreeService_Remove_Handler ,
} ,
{
MethodName : "Move" ,
Handler : _TreeService_Move_Handler ,
} ,
{
MethodName : "GetNodeByPath" ,
Handler : _TreeService_GetNodeByPath_Handler ,
} ,
{
MethodName : "Apply" ,
Handler : _TreeService_Apply_Handler ,
} ,
} ,
2022-04-29 10:06:10 +00:00
Streams : [ ] grpc . StreamDesc {
{
StreamName : "GetSubTree" ,
Handler : _TreeService_GetSubTree_Handler ,
ServerStreams : true ,
} ,
2022-05-11 13:29:04 +00:00
{
StreamName : "GetOpLog" ,
Handler : _TreeService_GetOpLog_Handler ,
ServerStreams : true ,
} ,
2022-04-29 10:06:10 +00:00
} ,
2022-04-22 13:30:20 +00:00
Metadata : "pkg/services/tree/service.proto" ,
}