refactor: generate all go proto (#257)
Signed-off-by: zyy17 <zyylsxm@gmail.com>
This commit is contained in:
@@ -0,0 +1,145 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.21.6
|
||||
// source: greptime/v1/frontend/server.proto
|
||||
|
||||
package frontend
|
||||
|
||||
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.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// FrontendClient is the client API for Frontend 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 FrontendClient interface {
|
||||
// List all running processes on frontend.
|
||||
ListProcess(ctx context.Context, in *ListProcessRequest, opts ...grpc.CallOption) (*ListProcessResponse, error)
|
||||
// Kill a running process on frontend.
|
||||
KillProcess(ctx context.Context, in *KillProcessRequest, opts ...grpc.CallOption) (*KillProcessResponse, error)
|
||||
}
|
||||
|
||||
type frontendClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewFrontendClient(cc grpc.ClientConnInterface) FrontendClient {
|
||||
return &frontendClient{cc}
|
||||
}
|
||||
|
||||
func (c *frontendClient) ListProcess(ctx context.Context, in *ListProcessRequest, opts ...grpc.CallOption) (*ListProcessResponse, error) {
|
||||
out := new(ListProcessResponse)
|
||||
err := c.cc.Invoke(ctx, "/greptime.v1.frontend.Frontend/ListProcess", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *frontendClient) KillProcess(ctx context.Context, in *KillProcessRequest, opts ...grpc.CallOption) (*KillProcessResponse, error) {
|
||||
out := new(KillProcessResponse)
|
||||
err := c.cc.Invoke(ctx, "/greptime.v1.frontend.Frontend/KillProcess", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// FrontendServer is the server API for Frontend service.
|
||||
// All implementations must embed UnimplementedFrontendServer
|
||||
// for forward compatibility
|
||||
type FrontendServer interface {
|
||||
// List all running processes on frontend.
|
||||
ListProcess(context.Context, *ListProcessRequest) (*ListProcessResponse, error)
|
||||
// Kill a running process on frontend.
|
||||
KillProcess(context.Context, *KillProcessRequest) (*KillProcessResponse, error)
|
||||
mustEmbedUnimplementedFrontendServer()
|
||||
}
|
||||
|
||||
// UnimplementedFrontendServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedFrontendServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedFrontendServer) ListProcess(context.Context, *ListProcessRequest) (*ListProcessResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListProcess not implemented")
|
||||
}
|
||||
func (UnimplementedFrontendServer) KillProcess(context.Context, *KillProcessRequest) (*KillProcessResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method KillProcess not implemented")
|
||||
}
|
||||
func (UnimplementedFrontendServer) mustEmbedUnimplementedFrontendServer() {}
|
||||
|
||||
// UnsafeFrontendServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to FrontendServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeFrontendServer interface {
|
||||
mustEmbedUnimplementedFrontendServer()
|
||||
}
|
||||
|
||||
func RegisterFrontendServer(s grpc.ServiceRegistrar, srv FrontendServer) {
|
||||
s.RegisterService(&Frontend_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Frontend_ListProcess_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListProcessRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FrontendServer).ListProcess(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/greptime.v1.frontend.Frontend/ListProcess",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FrontendServer).ListProcess(ctx, req.(*ListProcessRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Frontend_KillProcess_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(KillProcessRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FrontendServer).KillProcess(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/greptime.v1.frontend.Frontend/KillProcess",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FrontendServer).KillProcess(ctx, req.(*KillProcessRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Frontend_ServiceDesc is the grpc.ServiceDesc for Frontend service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Frontend_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "greptime.v1.frontend.Frontend",
|
||||
HandlerType: (*FrontendServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ListProcess",
|
||||
Handler: _Frontend_ListProcess_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "KillProcess",
|
||||
Handler: _Frontend_KillProcess_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "greptime/v1/frontend/server.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user