mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-27 01:13:05 +00:00
d4265779ef
This does not have to be reviewed, here is some reasoning: Go (and go mod) is designed for having code available and we need to check in the generated code to make sure it is "go gettable". If we dont we give ourselves a headache trying to setup all the ci, tests etc to install and generate the code before it runs. Because the code isnt there, the plugins needed to generate the code fail to install... I didnt find any good documentation for this, but there is this github comment: https://github.com/golang/go/issues/34514#issuecomment-535406759
101 lines
3.7 KiB
Go
101 lines
3.7 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
|
|
package v1
|
|
|
|
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
|
|
|
|
// HeadscaleServiceClient is the client API for HeadscaleService 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 HeadscaleServiceClient interface {
|
|
GetMachine(ctx context.Context, in *GetMachineRequest, opts ...grpc.CallOption) (*Machine, error)
|
|
}
|
|
|
|
type headscaleServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewHeadscaleServiceClient(cc grpc.ClientConnInterface) HeadscaleServiceClient {
|
|
return &headscaleServiceClient{cc}
|
|
}
|
|
|
|
func (c *headscaleServiceClient) GetMachine(ctx context.Context, in *GetMachineRequest, opts ...grpc.CallOption) (*Machine, error) {
|
|
out := new(Machine)
|
|
err := c.cc.Invoke(ctx, "/headscale.v1.HeadscaleService/GetMachine", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// HeadscaleServiceServer is the server API for HeadscaleService service.
|
|
// All implementations must embed UnimplementedHeadscaleServiceServer
|
|
// for forward compatibility
|
|
type HeadscaleServiceServer interface {
|
|
GetMachine(context.Context, *GetMachineRequest) (*Machine, error)
|
|
mustEmbedUnimplementedHeadscaleServiceServer()
|
|
}
|
|
|
|
// UnimplementedHeadscaleServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedHeadscaleServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedHeadscaleServiceServer) GetMachine(context.Context, *GetMachineRequest) (*Machine, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetMachine not implemented")
|
|
}
|
|
func (UnimplementedHeadscaleServiceServer) mustEmbedUnimplementedHeadscaleServiceServer() {}
|
|
|
|
// UnsafeHeadscaleServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to HeadscaleServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeHeadscaleServiceServer interface {
|
|
mustEmbedUnimplementedHeadscaleServiceServer()
|
|
}
|
|
|
|
func RegisterHeadscaleServiceServer(s grpc.ServiceRegistrar, srv HeadscaleServiceServer) {
|
|
s.RegisterService(&HeadscaleService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _HeadscaleService_GetMachine_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetMachineRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(HeadscaleServiceServer).GetMachine(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/headscale.v1.HeadscaleService/GetMachine",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(HeadscaleServiceServer).GetMachine(ctx, req.(*GetMachineRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// HeadscaleService_ServiceDesc is the grpc.ServiceDesc for HeadscaleService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var HeadscaleService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "headscale.v1.HeadscaleService",
|
|
HandlerType: (*HeadscaleServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "GetMachine",
|
|
Handler: _HeadscaleService_GetMachine_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "v1/headscale.proto",
|
|
}
|