mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-09-27 18:12:10 +08:00
134 lines
5.0 KiB
Go
134 lines
5.0 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
|
|
package gen
|
|
|
|
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.
|
|
const _ = grpc.SupportPackageIsVersion7
|
|
|
|
// NamespaceServiceClient is the client API for NamespaceService 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 NamespaceServiceClient interface {
|
|
ListNamespaces(ctx context.Context, in *ListNamespacesRequest, opts ...grpc.CallOption) (*ListNamespacesResponse, error)
|
|
CreateNamespace(ctx context.Context, in *CreateNamespaceRequest, opts ...grpc.CallOption) (*Namespace, error)
|
|
}
|
|
|
|
type namespaceServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewNamespaceServiceClient(cc grpc.ClientConnInterface) NamespaceServiceClient {
|
|
return &namespaceServiceClient{cc}
|
|
}
|
|
|
|
func (c *namespaceServiceClient) ListNamespaces(ctx context.Context, in *ListNamespacesRequest, opts ...grpc.CallOption) (*ListNamespacesResponse, error) {
|
|
out := new(ListNamespacesResponse)
|
|
err := c.cc.Invoke(ctx, "/api.NamespaceService/ListNamespaces", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *namespaceServiceClient) CreateNamespace(ctx context.Context, in *CreateNamespaceRequest, opts ...grpc.CallOption) (*Namespace, error) {
|
|
out := new(Namespace)
|
|
err := c.cc.Invoke(ctx, "/api.NamespaceService/CreateNamespace", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// NamespaceServiceServer is the server API for NamespaceService service.
|
|
// All implementations must embed UnimplementedNamespaceServiceServer
|
|
// for forward compatibility
|
|
type NamespaceServiceServer interface {
|
|
ListNamespaces(context.Context, *ListNamespacesRequest) (*ListNamespacesResponse, error)
|
|
CreateNamespace(context.Context, *CreateNamespaceRequest) (*Namespace, error)
|
|
mustEmbedUnimplementedNamespaceServiceServer()
|
|
}
|
|
|
|
// UnimplementedNamespaceServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedNamespaceServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedNamespaceServiceServer) ListNamespaces(context.Context, *ListNamespacesRequest) (*ListNamespacesResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ListNamespaces not implemented")
|
|
}
|
|
func (UnimplementedNamespaceServiceServer) CreateNamespace(context.Context, *CreateNamespaceRequest) (*Namespace, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method CreateNamespace not implemented")
|
|
}
|
|
func (UnimplementedNamespaceServiceServer) mustEmbedUnimplementedNamespaceServiceServer() {}
|
|
|
|
// UnsafeNamespaceServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to NamespaceServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeNamespaceServiceServer interface {
|
|
mustEmbedUnimplementedNamespaceServiceServer()
|
|
}
|
|
|
|
func RegisterNamespaceServiceServer(s grpc.ServiceRegistrar, srv NamespaceServiceServer) {
|
|
s.RegisterService(&_NamespaceService_serviceDesc, srv)
|
|
}
|
|
|
|
func _NamespaceService_ListNamespaces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListNamespacesRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(NamespaceServiceServer).ListNamespaces(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/api.NamespaceService/ListNamespaces",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(NamespaceServiceServer).ListNamespaces(ctx, req.(*ListNamespacesRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _NamespaceService_CreateNamespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateNamespaceRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(NamespaceServiceServer).CreateNamespace(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/api.NamespaceService/CreateNamespace",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(NamespaceServiceServer).CreateNamespace(ctx, req.(*CreateNamespaceRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _NamespaceService_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "api.NamespaceService",
|
|
HandlerType: (*NamespaceServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "ListNamespaces",
|
|
Handler: _NamespaceService_ListNamespaces_Handler,
|
|
},
|
|
{
|
|
MethodName: "CreateNamespace",
|
|
Handler: _NamespaceService_CreateNamespace_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "namespace.proto",
|
|
}
|