// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v6.32.0
// source: rpc.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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	TerwayBackend_AllocIP_FullMethodName     = "/rpc.TerwayBackend/AllocIP"
	TerwayBackend_ReleaseIP_FullMethodName   = "/rpc.TerwayBackend/ReleaseIP"
	TerwayBackend_GetIPInfo_FullMethodName   = "/rpc.TerwayBackend/GetIPInfo"
	TerwayBackend_RecordEvent_FullMethodName = "/rpc.TerwayBackend/RecordEvent"
)

// TerwayBackendClient is the client API for TerwayBackend 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 TerwayBackendClient interface {
	AllocIP(ctx context.Context, in *AllocIPRequest, opts ...grpc.CallOption) (*AllocIPReply, error)
	ReleaseIP(ctx context.Context, in *ReleaseIPRequest, opts ...grpc.CallOption) (*ReleaseIPReply, error)
	GetIPInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoReply, error)
	RecordEvent(ctx context.Context, in *EventRequest, opts ...grpc.CallOption) (*EventReply, error)
}

type terwayBackendClient struct {
	cc grpc.ClientConnInterface
}

func NewTerwayBackendClient(cc grpc.ClientConnInterface) TerwayBackendClient {
	return &terwayBackendClient{cc}
}

func (c *terwayBackendClient) AllocIP(ctx context.Context, in *AllocIPRequest, opts ...grpc.CallOption) (*AllocIPReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AllocIPReply)
	err := c.cc.Invoke(ctx, TerwayBackend_AllocIP_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *terwayBackendClient) ReleaseIP(ctx context.Context, in *ReleaseIPRequest, opts ...grpc.CallOption) (*ReleaseIPReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ReleaseIPReply)
	err := c.cc.Invoke(ctx, TerwayBackend_ReleaseIP_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *terwayBackendClient) GetIPInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetInfoReply)
	err := c.cc.Invoke(ctx, TerwayBackend_GetIPInfo_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *terwayBackendClient) RecordEvent(ctx context.Context, in *EventRequest, opts ...grpc.CallOption) (*EventReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(EventReply)
	err := c.cc.Invoke(ctx, TerwayBackend_RecordEvent_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// TerwayBackendServer is the server API for TerwayBackend service.
// All implementations must embed UnimplementedTerwayBackendServer
// for forward compatibility.
type TerwayBackendServer interface {
	AllocIP(context.Context, *AllocIPRequest) (*AllocIPReply, error)
	ReleaseIP(context.Context, *ReleaseIPRequest) (*ReleaseIPReply, error)
	GetIPInfo(context.Context, *GetInfoRequest) (*GetInfoReply, error)
	RecordEvent(context.Context, *EventRequest) (*EventReply, error)
	mustEmbedUnimplementedTerwayBackendServer()
}

// UnimplementedTerwayBackendServer 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 UnimplementedTerwayBackendServer struct{}

func (UnimplementedTerwayBackendServer) AllocIP(context.Context, *AllocIPRequest) (*AllocIPReply, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AllocIP not implemented")
}
func (UnimplementedTerwayBackendServer) ReleaseIP(context.Context, *ReleaseIPRequest) (*ReleaseIPReply, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ReleaseIP not implemented")
}
func (UnimplementedTerwayBackendServer) GetIPInfo(context.Context, *GetInfoRequest) (*GetInfoReply, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetIPInfo not implemented")
}
func (UnimplementedTerwayBackendServer) RecordEvent(context.Context, *EventRequest) (*EventReply, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RecordEvent not implemented")
}
func (UnimplementedTerwayBackendServer) mustEmbedUnimplementedTerwayBackendServer() {}
func (UnimplementedTerwayBackendServer) testEmbeddedByValue()                       {}

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

func RegisterTerwayBackendServer(s grpc.ServiceRegistrar, srv TerwayBackendServer) {
	// If the following call pancis, it indicates UnimplementedTerwayBackendServer 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(&TerwayBackend_ServiceDesc, srv)
}

func _TerwayBackend_AllocIP_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AllocIPRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TerwayBackendServer).AllocIP(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TerwayBackend_AllocIP_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TerwayBackendServer).AllocIP(ctx, req.(*AllocIPRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TerwayBackend_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.(TerwayBackendServer).ReleaseIP(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TerwayBackend_ReleaseIP_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TerwayBackendServer).ReleaseIP(ctx, req.(*ReleaseIPRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TerwayBackend_GetIPInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetInfoRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TerwayBackendServer).GetIPInfo(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TerwayBackend_GetIPInfo_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TerwayBackendServer).GetIPInfo(ctx, req.(*GetInfoRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TerwayBackend_RecordEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(EventRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TerwayBackendServer).RecordEvent(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TerwayBackend_RecordEvent_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TerwayBackendServer).RecordEvent(ctx, req.(*EventRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// TerwayBackend_ServiceDesc is the grpc.ServiceDesc for TerwayBackend service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var TerwayBackend_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "rpc.TerwayBackend",
	HandlerType: (*TerwayBackendServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AllocIP",
			Handler:    _TerwayBackend_AllocIP_Handler,
		},
		{
			MethodName: "ReleaseIP",
			Handler:    _TerwayBackend_ReleaseIP_Handler,
		},
		{
			MethodName: "GetIPInfo",
			Handler:    _TerwayBackend_GetIPInfo_Handler,
		},
		{
			MethodName: "RecordEvent",
			Handler:    _TerwayBackend_RecordEvent_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "rpc.proto",
}
