232 lines
8.0 KiB
Go
232 lines
8.0 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.5.1
|
|
// - protoc v3.12.4
|
|
// source: dhcp_server.proto
|
|
|
|
package dhcpServer
|
|
|
|
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 (
|
|
StaService_GetSta_FullMethodName = "/StaService/GetSta"
|
|
)
|
|
|
|
// StaServiceClient is the client API for StaService 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.
|
|
//
|
|
// The get sta service definition.
|
|
type StaServiceClient interface {
|
|
GetSta(ctx context.Context, in *MacAddr, opts ...grpc.CallOption) (*StaDhcpInfo, error)
|
|
}
|
|
|
|
type staServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewStaServiceClient(cc grpc.ClientConnInterface) StaServiceClient {
|
|
return &staServiceClient{cc}
|
|
}
|
|
|
|
func (c *staServiceClient) GetSta(ctx context.Context, in *MacAddr, opts ...grpc.CallOption) (*StaDhcpInfo, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(StaDhcpInfo)
|
|
err := c.cc.Invoke(ctx, StaService_GetSta_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// StaServiceServer is the server API for StaService service.
|
|
// All implementations must embed UnimplementedStaServiceServer
|
|
// for forward compatibility.
|
|
//
|
|
// The get sta service definition.
|
|
type StaServiceServer interface {
|
|
GetSta(context.Context, *MacAddr) (*StaDhcpInfo, error)
|
|
mustEmbedUnimplementedStaServiceServer()
|
|
}
|
|
|
|
// UnimplementedStaServiceServer 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 UnimplementedStaServiceServer struct{}
|
|
|
|
func (UnimplementedStaServiceServer) GetSta(context.Context, *MacAddr) (*StaDhcpInfo, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetSta not implemented")
|
|
}
|
|
func (UnimplementedStaServiceServer) mustEmbedUnimplementedStaServiceServer() {}
|
|
func (UnimplementedStaServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeStaServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to StaServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeStaServiceServer interface {
|
|
mustEmbedUnimplementedStaServiceServer()
|
|
}
|
|
|
|
func RegisterStaServiceServer(s grpc.ServiceRegistrar, srv StaServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedStaServiceServer 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(&StaService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _StaService_GetSta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(MacAddr)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(StaServiceServer).GetSta(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: StaService_GetSta_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(StaServiceServer).GetSta(ctx, req.(*MacAddr))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// StaService_ServiceDesc is the grpc.ServiceDesc for StaService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var StaService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "StaService",
|
|
HandlerType: (*StaServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "GetSta",
|
|
Handler: _StaService_GetSta_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "dhcp_server.proto",
|
|
}
|
|
|
|
const (
|
|
DhcpService_GetDhcp_FullMethodName = "/DhcpService/GetDhcp"
|
|
)
|
|
|
|
// DhcpServiceClient is the client API for DhcpService 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.
|
|
//
|
|
// The get dhcp service definition.
|
|
type DhcpServiceClient interface {
|
|
GetDhcp(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*DhcpInfo, error)
|
|
}
|
|
|
|
type dhcpServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewDhcpServiceClient(cc grpc.ClientConnInterface) DhcpServiceClient {
|
|
return &dhcpServiceClient{cc}
|
|
}
|
|
|
|
func (c *dhcpServiceClient) GetDhcp(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*DhcpInfo, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(DhcpInfo)
|
|
err := c.cc.Invoke(ctx, DhcpService_GetDhcp_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// DhcpServiceServer is the server API for DhcpService service.
|
|
// All implementations must embed UnimplementedDhcpServiceServer
|
|
// for forward compatibility.
|
|
//
|
|
// The get dhcp service definition.
|
|
type DhcpServiceServer interface {
|
|
GetDhcp(context.Context, *EmptyRequest) (*DhcpInfo, error)
|
|
mustEmbedUnimplementedDhcpServiceServer()
|
|
}
|
|
|
|
// UnimplementedDhcpServiceServer 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 UnimplementedDhcpServiceServer struct{}
|
|
|
|
func (UnimplementedDhcpServiceServer) GetDhcp(context.Context, *EmptyRequest) (*DhcpInfo, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetDhcp not implemented")
|
|
}
|
|
func (UnimplementedDhcpServiceServer) mustEmbedUnimplementedDhcpServiceServer() {}
|
|
func (UnimplementedDhcpServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeDhcpServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to DhcpServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeDhcpServiceServer interface {
|
|
mustEmbedUnimplementedDhcpServiceServer()
|
|
}
|
|
|
|
func RegisterDhcpServiceServer(s grpc.ServiceRegistrar, srv DhcpServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedDhcpServiceServer 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(&DhcpService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _DhcpService_GetDhcp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(EmptyRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(DhcpServiceServer).GetDhcp(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: DhcpService_GetDhcp_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(DhcpServiceServer).GetDhcp(ctx, req.(*EmptyRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// DhcpService_ServiceDesc is the grpc.ServiceDesc for DhcpService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var DhcpService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "DhcpService",
|
|
HandlerType: (*DhcpServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "GetDhcp",
|
|
Handler: _DhcpService_GetDhcp_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "dhcp_server.proto",
|
|
}
|