softplayer-go-proto/pkg/environments/environments_v1_grpc.pb.go

275 lines
9.3 KiB
Go
Raw Normal View History

2024-03-17 18:28:54 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package environments
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// 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
// EnvironmentsClient is the client API for Environments 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 EnvironmentsClient interface {
Create(ctx context.Context, in *EnvironmentData, opts ...grpc.CallOption) (*EnvironmentFull, error)
Update(ctx context.Context, in *EnvironmentFull, opts ...grpc.CallOption) (*EnvironmentFull, error)
Delete(ctx context.Context, in *EnvironmentFull, opts ...grpc.CallOption) (*emptypb.Empty, error)
2024-04-19 14:48:44 +00:00
Get(ctx context.Context, in *EnvironmentName, opts ...grpc.CallOption) (*EnvironmentFull, error)
2024-03-17 18:28:54 +00:00
List(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Environments_ListClient, error)
}
type environmentsClient struct {
cc grpc.ClientConnInterface
}
func NewEnvironmentsClient(cc grpc.ClientConnInterface) EnvironmentsClient {
return &environmentsClient{cc}
}
func (c *environmentsClient) Create(ctx context.Context, in *EnvironmentData, opts ...grpc.CallOption) (*EnvironmentFull, error) {
out := new(EnvironmentFull)
err := c.cc.Invoke(ctx, "/environments.Environments/Create", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *environmentsClient) Update(ctx context.Context, in *EnvironmentFull, opts ...grpc.CallOption) (*EnvironmentFull, error) {
out := new(EnvironmentFull)
err := c.cc.Invoke(ctx, "/environments.Environments/Update", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *environmentsClient) Delete(ctx context.Context, in *EnvironmentFull, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/environments.Environments/Delete", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
2024-04-19 14:48:44 +00:00
func (c *environmentsClient) Get(ctx context.Context, in *EnvironmentName, opts ...grpc.CallOption) (*EnvironmentFull, error) {
2024-03-17 18:28:54 +00:00
out := new(EnvironmentFull)
err := c.cc.Invoke(ctx, "/environments.Environments/Get", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *environmentsClient) List(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Environments_ListClient, error) {
stream, err := c.cc.NewStream(ctx, &Environments_ServiceDesc.Streams[0], "/environments.Environments/List", opts...)
if err != nil {
return nil, err
}
x := &environmentsListClient{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 Environments_ListClient interface {
2024-04-19 14:48:44 +00:00
Recv() (*EnvironmentName, error)
2024-03-17 18:28:54 +00:00
grpc.ClientStream
}
type environmentsListClient struct {
grpc.ClientStream
}
2024-04-19 14:48:44 +00:00
func (x *environmentsListClient) Recv() (*EnvironmentName, error) {
m := new(EnvironmentName)
2024-03-17 18:28:54 +00:00
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// EnvironmentsServer is the server API for Environments service.
// All implementations must embed UnimplementedEnvironmentsServer
// for forward compatibility
type EnvironmentsServer interface {
Create(context.Context, *EnvironmentData) (*EnvironmentFull, error)
Update(context.Context, *EnvironmentFull) (*EnvironmentFull, error)
Delete(context.Context, *EnvironmentFull) (*emptypb.Empty, error)
2024-04-19 14:48:44 +00:00
Get(context.Context, *EnvironmentName) (*EnvironmentFull, error)
2024-03-17 18:28:54 +00:00
List(*emptypb.Empty, Environments_ListServer) error
mustEmbedUnimplementedEnvironmentsServer()
}
// UnimplementedEnvironmentsServer must be embedded to have forward compatible implementations.
type UnimplementedEnvironmentsServer struct {
}
func (UnimplementedEnvironmentsServer) Create(context.Context, *EnvironmentData) (*EnvironmentFull, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedEnvironmentsServer) Update(context.Context, *EnvironmentFull) (*EnvironmentFull, error) {
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedEnvironmentsServer) Delete(context.Context, *EnvironmentFull) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
2024-04-19 14:48:44 +00:00
func (UnimplementedEnvironmentsServer) Get(context.Context, *EnvironmentName) (*EnvironmentFull, error) {
2024-03-17 18:28:54 +00:00
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedEnvironmentsServer) List(*emptypb.Empty, Environments_ListServer) error {
return status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedEnvironmentsServer) mustEmbedUnimplementedEnvironmentsServer() {}
// UnsafeEnvironmentsServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to EnvironmentsServer will
// result in compilation errors.
type UnsafeEnvironmentsServer interface {
mustEmbedUnimplementedEnvironmentsServer()
}
func RegisterEnvironmentsServer(s grpc.ServiceRegistrar, srv EnvironmentsServer) {
s.RegisterService(&Environments_ServiceDesc, srv)
}
func _Environments_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EnvironmentData)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EnvironmentsServer).Create(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/environments.Environments/Create",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EnvironmentsServer).Create(ctx, req.(*EnvironmentData))
}
return interceptor(ctx, in, info, handler)
}
func _Environments_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EnvironmentFull)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EnvironmentsServer).Update(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/environments.Environments/Update",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EnvironmentsServer).Update(ctx, req.(*EnvironmentFull))
}
return interceptor(ctx, in, info, handler)
}
func _Environments_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EnvironmentFull)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EnvironmentsServer).Delete(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/environments.Environments/Delete",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EnvironmentsServer).Delete(ctx, req.(*EnvironmentFull))
}
return interceptor(ctx, in, info, handler)
}
func _Environments_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
2024-04-19 14:48:44 +00:00
in := new(EnvironmentName)
2024-03-17 18:28:54 +00:00
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EnvironmentsServer).Get(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/environments.Environments/Get",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
2024-04-19 14:48:44 +00:00
return srv.(EnvironmentsServer).Get(ctx, req.(*EnvironmentName))
2024-03-17 18:28:54 +00:00
}
return interceptor(ctx, in, info, handler)
}
func _Environments_List_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(emptypb.Empty)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(EnvironmentsServer).List(m, &environmentsListServer{stream})
}
type Environments_ListServer interface {
2024-04-19 14:48:44 +00:00
Send(*EnvironmentName) error
2024-03-17 18:28:54 +00:00
grpc.ServerStream
}
type environmentsListServer struct {
grpc.ServerStream
}
2024-04-19 14:48:44 +00:00
func (x *environmentsListServer) Send(m *EnvironmentName) error {
2024-03-17 18:28:54 +00:00
return x.ServerStream.SendMsg(m)
}
// Environments_ServiceDesc is the grpc.ServiceDesc for Environments service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Environments_ServiceDesc = grpc.ServiceDesc{
ServiceName: "environments.Environments",
HandlerType: (*EnvironmentsServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Create",
Handler: _Environments_Create_Handler,
},
{
MethodName: "Update",
Handler: _Environments_Update_Handler,
},
{
MethodName: "Delete",
Handler: _Environments_Delete_Handler,
},
{
MethodName: "Get",
Handler: _Environments_Get_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "List",
Handler: _Environments_List_Handler,
ServerStreams: true,
},
},
2024-03-18 10:15:28 +00:00
Metadata: "environments/environments_v1.proto",
2024-03-17 18:28:54 +00:00
}