mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-04 08:57:42 +08:00
274 lines
9.6 KiB
Go
274 lines
9.6 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.5.1
|
|
// - protoc v3.21.11
|
|
// source: api/polaris/v1/api.proto
|
|
|
|
package v1
|
|
|
|
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 (
|
|
Api_CreateApi_FullMethodName = "/api.polaris.v1.Api/CreateApi"
|
|
Api_UpdateApi_FullMethodName = "/api.polaris.v1.Api/UpdateApi"
|
|
Api_DeleteApi_FullMethodName = "/api.polaris.v1.Api/DeleteApi"
|
|
Api_GetApi_FullMethodName = "/api.polaris.v1.Api/GetApi"
|
|
Api_ListApi_FullMethodName = "/api.polaris.v1.Api/ListApi"
|
|
)
|
|
|
|
// ApiClient is the client API for Api 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 ApiClient interface {
|
|
CreateApi(ctx context.Context, in *CreateApiRequest, opts ...grpc.CallOption) (*CreateApiReply, error)
|
|
UpdateApi(ctx context.Context, in *UpdateApiRequest, opts ...grpc.CallOption) (*UpdateApiReply, error)
|
|
DeleteApi(ctx context.Context, in *DeleteApiRequest, opts ...grpc.CallOption) (*DeleteApiReply, error)
|
|
GetApi(ctx context.Context, in *GetApiRequest, opts ...grpc.CallOption) (*GetApiReply, error)
|
|
ListApi(ctx context.Context, in *ListApiRequest, opts ...grpc.CallOption) (*ListApiReply, error)
|
|
}
|
|
|
|
type apiClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewApiClient(cc grpc.ClientConnInterface) ApiClient {
|
|
return &apiClient{cc}
|
|
}
|
|
|
|
func (c *apiClient) CreateApi(ctx context.Context, in *CreateApiRequest, opts ...grpc.CallOption) (*CreateApiReply, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(CreateApiReply)
|
|
err := c.cc.Invoke(ctx, Api_CreateApi_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *apiClient) UpdateApi(ctx context.Context, in *UpdateApiRequest, opts ...grpc.CallOption) (*UpdateApiReply, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(UpdateApiReply)
|
|
err := c.cc.Invoke(ctx, Api_UpdateApi_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *apiClient) DeleteApi(ctx context.Context, in *DeleteApiRequest, opts ...grpc.CallOption) (*DeleteApiReply, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(DeleteApiReply)
|
|
err := c.cc.Invoke(ctx, Api_DeleteApi_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *apiClient) GetApi(ctx context.Context, in *GetApiRequest, opts ...grpc.CallOption) (*GetApiReply, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(GetApiReply)
|
|
err := c.cc.Invoke(ctx, Api_GetApi_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *apiClient) ListApi(ctx context.Context, in *ListApiRequest, opts ...grpc.CallOption) (*ListApiReply, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListApiReply)
|
|
err := c.cc.Invoke(ctx, Api_ListApi_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// ApiServer is the server API for Api service.
|
|
// All implementations must embed UnimplementedApiServer
|
|
// for forward compatibility.
|
|
type ApiServer interface {
|
|
CreateApi(context.Context, *CreateApiRequest) (*CreateApiReply, error)
|
|
UpdateApi(context.Context, *UpdateApiRequest) (*UpdateApiReply, error)
|
|
DeleteApi(context.Context, *DeleteApiRequest) (*DeleteApiReply, error)
|
|
GetApi(context.Context, *GetApiRequest) (*GetApiReply, error)
|
|
ListApi(context.Context, *ListApiRequest) (*ListApiReply, error)
|
|
mustEmbedUnimplementedApiServer()
|
|
}
|
|
|
|
// UnimplementedApiServer must 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 UnimplementedApiServer struct{}
|
|
|
|
func (UnimplementedApiServer) CreateApi(context.Context, *CreateApiRequest) (*CreateApiReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method CreateApi not implemented")
|
|
}
|
|
func (UnimplementedApiServer) UpdateApi(context.Context, *UpdateApiRequest) (*UpdateApiReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateApi not implemented")
|
|
}
|
|
func (UnimplementedApiServer) DeleteApi(context.Context, *DeleteApiRequest) (*DeleteApiReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteApi not implemented")
|
|
}
|
|
func (UnimplementedApiServer) GetApi(context.Context, *GetApiRequest) (*GetApiReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetApi not implemented")
|
|
}
|
|
func (UnimplementedApiServer) ListApi(context.Context, *ListApiRequest) (*ListApiReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ListApi not implemented")
|
|
}
|
|
func (UnimplementedApiServer) mustEmbedUnimplementedApiServer() {}
|
|
func (UnimplementedApiServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeApiServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to ApiServer will
|
|
// result in compilation errors.
|
|
type UnsafeApiServer interface {
|
|
mustEmbedUnimplementedApiServer()
|
|
}
|
|
|
|
func RegisterApiServer(s grpc.ServiceRegistrar, srv ApiServer) {
|
|
// If the following call pancis, it indicates UnimplementedApiServer 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(&Api_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Api_CreateApi_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateApiRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ApiServer).CreateApi(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Api_CreateApi_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ApiServer).CreateApi(ctx, req.(*CreateApiRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Api_UpdateApi_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateApiRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ApiServer).UpdateApi(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Api_UpdateApi_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ApiServer).UpdateApi(ctx, req.(*UpdateApiRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Api_DeleteApi_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteApiRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ApiServer).DeleteApi(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Api_DeleteApi_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ApiServer).DeleteApi(ctx, req.(*DeleteApiRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Api_GetApi_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetApiRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ApiServer).GetApi(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Api_GetApi_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ApiServer).GetApi(ctx, req.(*GetApiRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Api_ListApi_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListApiRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ApiServer).ListApi(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Api_ListApi_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ApiServer).ListApi(ctx, req.(*ListApiRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Api_ServiceDesc is the grpc.ServiceDesc for Api service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Api_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "api.polaris.v1.Api",
|
|
HandlerType: (*ApiServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "CreateApi",
|
|
Handler: _Api_CreateApi_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateApi",
|
|
Handler: _Api_UpdateApi_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeleteApi",
|
|
Handler: _Api_DeleteApi_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetApi",
|
|
Handler: _Api_GetApi_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListApi",
|
|
Handler: _Api_ListApi_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "api/polaris/v1/api.proto",
|
|
}
|