kubenetworks/kubevpn

View on GitHub
pkg/dhcp/rpc/dhcpserver_grpc.pb.go

Summary

Maintainability
B
6 hrs
Test Coverage
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v3.21.2
// source: dhcpserver.proto

package rpc

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

const (
    DHCP_RentIP_FullMethodName    = "/rpc.DHCP/RentIP"
    DHCP_ReleaseIP_FullMethodName = "/rpc.DHCP/ReleaseIP"
)

// DHCPClient is the client API for DHCP 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 DHCPClient interface {
    RentIP(ctx context.Context, in *RentIPRequest, opts ...grpc.CallOption) (*RentIPResponse, error)
    ReleaseIP(ctx context.Context, in *ReleaseIPRequest, opts ...grpc.CallOption) (*ReleaseIPResponse, error)
}

type dHCPClient struct {
    cc grpc.ClientConnInterface
}

func NewDHCPClient(cc grpc.ClientConnInterface) DHCPClient {
    return &dHCPClient{cc}
}

func (c *dHCPClient) RentIP(ctx context.Context, in *RentIPRequest, opts ...grpc.CallOption) (*RentIPResponse, error) {
    out := new(RentIPResponse)
    err := c.cc.Invoke(ctx, DHCP_RentIP_FullMethodName, in, out, opts...)
    if err != nil {
        return nil, err
    }
    return out, nil
}

func (c *dHCPClient) ReleaseIP(ctx context.Context, in *ReleaseIPRequest, opts ...grpc.CallOption) (*ReleaseIPResponse, error) {
    out := new(ReleaseIPResponse)
    err := c.cc.Invoke(ctx, DHCP_ReleaseIP_FullMethodName, in, out, opts...)
    if err != nil {
        return nil, err
    }
    return out, nil
}

// DHCPServer is the server API for DHCP service.
// All implementations must embed UnimplementedDHCPServer
// for forward compatibility
type DHCPServer interface {
    RentIP(context.Context, *RentIPRequest) (*RentIPResponse, error)
    ReleaseIP(context.Context, *ReleaseIPRequest) (*ReleaseIPResponse, error)
    mustEmbedUnimplementedDHCPServer()
}

// UnimplementedDHCPServer must be embedded to have forward compatible implementations.
type UnimplementedDHCPServer struct {
}

func (UnimplementedDHCPServer) RentIP(context.Context, *RentIPRequest) (*RentIPResponse, error) {
    return nil, status.Errorf(codes.Unimplemented, "method RentIP not implemented")
}
func (UnimplementedDHCPServer) ReleaseIP(context.Context, *ReleaseIPRequest) (*ReleaseIPResponse, error) {
    return nil, status.Errorf(codes.Unimplemented, "method ReleaseIP not implemented")
}
func (UnimplementedDHCPServer) mustEmbedUnimplementedDHCPServer() {}

// UnsafeDHCPServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DHCPServer will
// result in compilation errors.
type UnsafeDHCPServer interface {
    mustEmbedUnimplementedDHCPServer()
}

func RegisterDHCPServer(s grpc.ServiceRegistrar, srv DHCPServer) {
    s.RegisterService(&DHCP_ServiceDesc, srv)
}

func _DHCP_RentIP_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(RentIPRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
    if interceptor == nil {
        return srv.(DHCPServer).RentIP(ctx, in)
    }
    info := &grpc.UnaryServerInfo{
        Server:     srv,
        FullMethod: DHCP_RentIP_FullMethodName,
    }
    handler := func(ctx context.Context, req interface{}) (interface{}, error) {
        return srv.(DHCPServer).RentIP(ctx, req.(*RentIPRequest))
    }
    return interceptor(ctx, in, info, handler)
}

func _DHCP_ReleaseIP_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(ReleaseIPRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
    if interceptor == nil {
        return srv.(DHCPServer).ReleaseIP(ctx, in)
    }
    info := &grpc.UnaryServerInfo{
        Server:     srv,
        FullMethod: DHCP_ReleaseIP_FullMethodName,
    }
    handler := func(ctx context.Context, req interface{}) (interface{}, error) {
        return srv.(DHCPServer).ReleaseIP(ctx, req.(*ReleaseIPRequest))
    }
    return interceptor(ctx, in, info, handler)
}

// DHCP_ServiceDesc is the grpc.ServiceDesc for DHCP service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var DHCP_ServiceDesc = grpc.ServiceDesc{
    ServiceName: "rpc.DHCP",
    HandlerType: (*DHCPServer)(nil),
    Methods: []grpc.MethodDesc{
        {
            MethodName: "RentIP",
            Handler:    _DHCP_RentIP_Handler,
        },
        {
            MethodName: "ReleaseIP",
            Handler:    _DHCP_ReleaseIP_Handler,
        },
    },
    Streams:  []grpc.StreamDesc{},
    Metadata: "dhcpserver.proto",
}