2021-10-29 18:43:10 +02:00
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
2021-10-30 16:29:41 +02:00
// source: headscale/v1/headscale.proto
2021-10-29 18:43:10 +02:00
/ *
Package v1 is a reverse proxy .
It translates gRPC into RESTful JSON APIs .
* /
package v1
import (
"context"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)
// Suppress "imported and not used" errors
var _ codes . Code
var _ io . Reader
var _ status . Status
var _ = runtime . String
var _ = utilities . NewDoubleArray
var _ = metadata . Join
2021-11-04 23:07:59 +01:00
func request_HeadscaleService_GetNamespace_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq GetNamespaceRequest
2021-10-29 18:43:10 +02:00
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
2021-11-04 23:07:59 +01:00
val , ok = pathParams [ "name" ]
2021-10-29 18:43:10 +02:00
if ! ok {
2021-11-04 23:07:59 +01:00
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "name" )
2021-10-29 18:43:10 +02:00
}
2021-11-04 23:07:59 +01:00
protoReq . Name , err = runtime . String ( val )
2021-10-29 18:43:10 +02:00
if err != nil {
2021-11-04 23:07:59 +01:00
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "name" , err )
2021-10-29 18:43:10 +02:00
}
2021-11-04 23:07:59 +01:00
msg , err := client . GetNamespace ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
2021-10-29 18:43:10 +02:00
return msg , metadata , err
}
2021-11-04 23:07:59 +01:00
func local_request_HeadscaleService_GetNamespace_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq GetNamespaceRequest
2021-10-29 18:43:10 +02:00
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
2021-11-04 23:07:59 +01:00
val , ok = pathParams [ "name" ]
2021-10-29 18:43:10 +02:00
if ! ok {
2021-11-04 23:07:59 +01:00
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "name" )
2021-10-29 18:43:10 +02:00
}
2021-11-04 23:07:59 +01:00
protoReq . Name , err = runtime . String ( val )
2021-10-29 18:43:10 +02:00
if err != nil {
2021-11-04 23:07:59 +01:00
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "name" , err )
2021-10-29 18:43:10 +02:00
}
2021-11-04 23:07:59 +01:00
msg , err := server . GetNamespace ( ctx , & protoReq )
2021-10-29 18:43:10 +02:00
return msg , metadata , err
}
func request_HeadscaleService_CreateNamespace_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq CreateNamespaceRequest
var metadata runtime . ServerMetadata
newReader , berr := utilities . IOReaderFactory ( req . Body )
if berr != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , berr )
}
if err := marshaler . NewDecoder ( newReader ( ) ) . Decode ( & protoReq ) ; err != nil && err != io . EOF {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := client . CreateNamespace ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_CreateNamespace_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq CreateNamespaceRequest
var metadata runtime . ServerMetadata
newReader , berr := utilities . IOReaderFactory ( req . Body )
if berr != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , berr )
}
if err := marshaler . NewDecoder ( newReader ( ) ) . Decode ( & protoReq ) ; err != nil && err != io . EOF {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := server . CreateNamespace ( ctx , & protoReq )
return msg , metadata , err
}
2021-11-04 23:07:59 +01:00
func request_HeadscaleService_RenameNamespace_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq RenameNamespaceRequest
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "old_name" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "old_name" )
}
protoReq . OldName , err = runtime . String ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "old_name" , err )
}
val , ok = pathParams [ "new_name" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "new_name" )
}
protoReq . NewName , err = runtime . String ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "new_name" , err )
}
msg , err := client . RenameNamespace ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_RenameNamespace_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq RenameNamespaceRequest
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "old_name" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "old_name" )
}
protoReq . OldName , err = runtime . String ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "old_name" , err )
}
val , ok = pathParams [ "new_name" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "new_name" )
}
protoReq . NewName , err = runtime . String ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "new_name" , err )
}
msg , err := server . RenameNamespace ( ctx , & protoReq )
return msg , metadata , err
}
2021-10-29 18:43:10 +02:00
func request_HeadscaleService_DeleteNamespace_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq DeleteNamespaceRequest
var metadata runtime . ServerMetadata
2021-11-04 23:07:59 +01:00
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "name" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "name" )
2021-10-29 18:43:10 +02:00
}
2021-11-04 23:07:59 +01:00
protoReq . Name , err = runtime . String ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "name" , err )
2021-10-29 18:43:10 +02:00
}
msg , err := client . DeleteNamespace ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_DeleteNamespace_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq DeleteNamespaceRequest
var metadata runtime . ServerMetadata
2021-11-04 23:07:59 +01:00
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "name" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "name" )
2021-10-29 18:43:10 +02:00
}
2021-11-04 23:07:59 +01:00
protoReq . Name , err = runtime . String ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "name" , err )
2021-10-29 18:43:10 +02:00
}
msg , err := server . DeleteNamespace ( ctx , & protoReq )
return msg , metadata , err
}
func request_HeadscaleService_ListNamespaces_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq ListNamespacesRequest
var metadata runtime . ServerMetadata
msg , err := client . ListNamespaces ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_ListNamespaces_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq ListNamespacesRequest
var metadata runtime . ServerMetadata
msg , err := server . ListNamespaces ( ctx , & protoReq )
return msg , metadata , err
}
2021-11-04 23:07:59 +01:00
func request_HeadscaleService_CreatePreAuthKey_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq CreatePreAuthKeyRequest
var metadata runtime . ServerMetadata
2021-10-29 18:43:10 +02:00
2021-11-04 23:07:59 +01:00
newReader , berr := utilities . IOReaderFactory ( req . Body )
if berr != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , berr )
}
if err := marshaler . NewDecoder ( newReader ( ) ) . Decode ( & protoReq ) ; err != nil && err != io . EOF {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
2021-10-29 18:43:10 +02:00
2021-11-04 23:07:59 +01:00
msg , err := client . CreatePreAuthKey ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
2021-10-29 18:43:10 +02:00
2021-11-04 23:07:59 +01:00
}
2021-10-29 18:43:10 +02:00
2021-11-04 23:07:59 +01:00
func local_request_HeadscaleService_CreatePreAuthKey_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq CreatePreAuthKeyRequest
var metadata runtime . ServerMetadata
newReader , berr := utilities . IOReaderFactory ( req . Body )
if berr != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , berr )
}
if err := marshaler . NewDecoder ( newReader ( ) ) . Decode ( & protoReq ) ; err != nil && err != io . EOF {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := server . CreatePreAuthKey ( ctx , & protoReq )
return msg , metadata , err
}
func request_HeadscaleService_ExpirePreAuthKey_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq ExpirePreAuthKeyRequest
var metadata runtime . ServerMetadata
newReader , berr := utilities . IOReaderFactory ( req . Body )
if berr != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , berr )
}
if err := marshaler . NewDecoder ( newReader ( ) ) . Decode ( & protoReq ) ; err != nil && err != io . EOF {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := client . ExpirePreAuthKey ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_ExpirePreAuthKey_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq ExpirePreAuthKeyRequest
var metadata runtime . ServerMetadata
newReader , berr := utilities . IOReaderFactory ( req . Body )
if berr != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , berr )
}
if err := marshaler . NewDecoder ( newReader ( ) ) . Decode ( & protoReq ) ; err != nil && err != io . EOF {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := server . ExpirePreAuthKey ( ctx , & protoReq )
return msg , metadata , err
}
var (
filter_HeadscaleService_ListPreAuthKeys_0 = & utilities . DoubleArray { Encoding : map [ string ] int { } , Base : [ ] int ( nil ) , Check : [ ] int ( nil ) }
)
func request_HeadscaleService_ListPreAuthKeys_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq ListPreAuthKeysRequest
var metadata runtime . ServerMetadata
if err := req . ParseForm ( ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
if err := runtime . PopulateQueryParameters ( & protoReq , req . Form , filter_HeadscaleService_ListPreAuthKeys_0 ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := client . ListPreAuthKeys ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_ListPreAuthKeys_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq ListPreAuthKeysRequest
var metadata runtime . ServerMetadata
if err := req . ParseForm ( ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
if err := runtime . PopulateQueryParameters ( & protoReq , req . Form , filter_HeadscaleService_ListPreAuthKeys_0 ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := server . ListPreAuthKeys ( ctx , & protoReq )
return msg , metadata , err
}
func request_HeadscaleService_DebugCreateMachine_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq DebugCreateMachineRequest
var metadata runtime . ServerMetadata
newReader , berr := utilities . IOReaderFactory ( req . Body )
if berr != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , berr )
}
if err := marshaler . NewDecoder ( newReader ( ) ) . Decode ( & protoReq ) ; err != nil && err != io . EOF {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := client . DebugCreateMachine ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_DebugCreateMachine_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq DebugCreateMachineRequest
var metadata runtime . ServerMetadata
newReader , berr := utilities . IOReaderFactory ( req . Body )
if berr != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , berr )
}
if err := marshaler . NewDecoder ( newReader ( ) ) . Decode ( & protoReq ) ; err != nil && err != io . EOF {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := server . DebugCreateMachine ( ctx , & protoReq )
return msg , metadata , err
}
func request_HeadscaleService_GetMachine_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq GetMachineRequest
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "machine_id" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "machine_id" )
}
protoReq . MachineId , err = runtime . Uint64 ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "machine_id" , err )
}
msg , err := client . GetMachine ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_GetMachine_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq GetMachineRequest
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "machine_id" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "machine_id" )
}
protoReq . MachineId , err = runtime . Uint64 ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "machine_id" , err )
}
msg , err := server . GetMachine ( ctx , & protoReq )
return msg , metadata , err
}
2022-04-25 20:45:33 +02:00
func request_HeadscaleService_SetTags_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq SetTagsRequest
2022-04-15 13:11:41 +02:00
var metadata runtime . ServerMetadata
newReader , berr := utilities . IOReaderFactory ( req . Body )
if berr != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , berr )
}
if err := marshaler . NewDecoder ( newReader ( ) ) . Decode ( & protoReq ) ; err != nil && err != io . EOF {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
var (
val string
ok bool
err error
_ = err
)
2022-04-25 20:45:33 +02:00
val , ok = pathParams [ "machine_id" ]
2022-04-15 13:11:41 +02:00
if ! ok {
2022-04-25 20:45:33 +02:00
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "machine_id" )
2022-04-15 13:11:41 +02:00
}
2022-04-25 20:45:33 +02:00
protoReq . MachineId , err = runtime . Uint64 ( val )
2022-04-15 13:11:41 +02:00
if err != nil {
2022-04-25 20:45:33 +02:00
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "machine_id" , err )
2022-04-15 13:11:41 +02:00
}
2022-04-25 20:45:33 +02:00
msg , err := client . SetTags ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
2022-04-15 13:11:41 +02:00
return msg , metadata , err
}
2022-04-25 20:45:33 +02:00
func local_request_HeadscaleService_SetTags_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq SetTagsRequest
2022-04-15 13:11:41 +02:00
var metadata runtime . ServerMetadata
newReader , berr := utilities . IOReaderFactory ( req . Body )
if berr != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , berr )
}
if err := marshaler . NewDecoder ( newReader ( ) ) . Decode ( & protoReq ) ; err != nil && err != io . EOF {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
var (
val string
ok bool
err error
_ = err
)
2022-04-25 20:45:33 +02:00
val , ok = pathParams [ "machine_id" ]
2022-04-15 13:11:41 +02:00
if ! ok {
2022-04-25 20:45:33 +02:00
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "machine_id" )
2022-04-15 13:11:41 +02:00
}
2022-04-25 20:45:33 +02:00
protoReq . MachineId , err = runtime . Uint64 ( val )
2022-04-15 13:11:41 +02:00
if err != nil {
2022-04-25 20:45:33 +02:00
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "machine_id" , err )
2022-04-15 13:11:41 +02:00
}
2022-04-25 20:45:33 +02:00
msg , err := server . SetTags ( ctx , & protoReq )
2022-04-15 13:11:41 +02:00
return msg , metadata , err
}
2021-11-04 23:07:59 +01:00
var (
filter_HeadscaleService_RegisterMachine_0 = & utilities . DoubleArray { Encoding : map [ string ] int { } , Base : [ ] int ( nil ) , Check : [ ] int ( nil ) }
)
func request_HeadscaleService_RegisterMachine_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq RegisterMachineRequest
var metadata runtime . ServerMetadata
if err := req . ParseForm ( ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
if err := runtime . PopulateQueryParameters ( & protoReq , req . Form , filter_HeadscaleService_RegisterMachine_0 ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := client . RegisterMachine ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_RegisterMachine_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq RegisterMachineRequest
var metadata runtime . ServerMetadata
if err := req . ParseForm ( ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
if err := runtime . PopulateQueryParameters ( & protoReq , req . Form , filter_HeadscaleService_RegisterMachine_0 ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := server . RegisterMachine ( ctx , & protoReq )
return msg , metadata , err
}
func request_HeadscaleService_DeleteMachine_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq DeleteMachineRequest
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "machine_id" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "machine_id" )
}
protoReq . MachineId , err = runtime . Uint64 ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "machine_id" , err )
}
msg , err := client . DeleteMachine ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_DeleteMachine_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq DeleteMachineRequest
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "machine_id" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "machine_id" )
}
protoReq . MachineId , err = runtime . Uint64 ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "machine_id" , err )
}
msg , err := server . DeleteMachine ( ctx , & protoReq )
return msg , metadata , err
}
2021-11-21 14:40:04 +01:00
func request_HeadscaleService_ExpireMachine_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq ExpireMachineRequest
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "machine_id" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "machine_id" )
}
protoReq . MachineId , err = runtime . Uint64 ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "machine_id" , err )
}
msg , err := client . ExpireMachine ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_ExpireMachine_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq ExpireMachineRequest
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "machine_id" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "machine_id" )
}
protoReq . MachineId , err = runtime . Uint64 ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "machine_id" , err )
}
msg , err := server . ExpireMachine ( ctx , & protoReq )
return msg , metadata , err
}
2022-03-13 22:03:20 +01:00
func request_HeadscaleService_RenameMachine_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq RenameMachineRequest
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "machine_id" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "machine_id" )
}
protoReq . MachineId , err = runtime . Uint64 ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "machine_id" , err )
}
val , ok = pathParams [ "new_name" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "new_name" )
}
protoReq . NewName , err = runtime . String ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "new_name" , err )
}
msg , err := client . RenameMachine ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_RenameMachine_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq RenameMachineRequest
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "machine_id" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "machine_id" )
}
protoReq . MachineId , err = runtime . Uint64 ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "machine_id" , err )
}
val , ok = pathParams [ "new_name" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "new_name" )
}
protoReq . NewName , err = runtime . String ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "new_name" , err )
}
msg , err := server . RenameMachine ( ctx , & protoReq )
return msg , metadata , err
}
2021-11-04 23:07:59 +01:00
var (
filter_HeadscaleService_ListMachines_0 = & utilities . DoubleArray { Encoding : map [ string ] int { } , Base : [ ] int ( nil ) , Check : [ ] int ( nil ) }
)
func request_HeadscaleService_ListMachines_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq ListMachinesRequest
var metadata runtime . ServerMetadata
if err := req . ParseForm ( ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
if err := runtime . PopulateQueryParameters ( & protoReq , req . Form , filter_HeadscaleService_ListMachines_0 ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := client . ListMachines ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_ListMachines_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq ListMachinesRequest
var metadata runtime . ServerMetadata
if err := req . ParseForm ( ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
if err := runtime . PopulateQueryParameters ( & protoReq , req . Form , filter_HeadscaleService_ListMachines_0 ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := server . ListMachines ( ctx , & protoReq )
return msg , metadata , err
}
2022-05-01 15:34:40 +02:00
var (
filter_HeadscaleService_MoveMachine_0 = & utilities . DoubleArray { Encoding : map [ string ] int { "machine_id" : 0 } , Base : [ ] int { 1 , 1 , 0 } , Check : [ ] int { 0 , 1 , 2 } }
)
func request_HeadscaleService_MoveMachine_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq MoveMachineRequest
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "machine_id" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "machine_id" )
}
protoReq . MachineId , err = runtime . Uint64 ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "machine_id" , err )
}
if err := req . ParseForm ( ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
if err := runtime . PopulateQueryParameters ( & protoReq , req . Form , filter_HeadscaleService_MoveMachine_0 ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := client . MoveMachine ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_MoveMachine_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq MoveMachineRequest
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "machine_id" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "machine_id" )
}
protoReq . MachineId , err = runtime . Uint64 ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "machine_id" , err )
}
if err := req . ParseForm ( ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
if err := runtime . PopulateQueryParameters ( & protoReq , req . Form , filter_HeadscaleService_MoveMachine_0 ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := server . MoveMachine ( ctx , & protoReq )
return msg , metadata , err
}
2021-11-04 23:07:59 +01:00
func request_HeadscaleService_GetMachineRoute_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq GetMachineRouteRequest
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "machine_id" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "machine_id" )
}
protoReq . MachineId , err = runtime . Uint64 ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "machine_id" , err )
}
msg , err := client . GetMachineRoute ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_GetMachineRoute_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq GetMachineRouteRequest
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "machine_id" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "machine_id" )
}
protoReq . MachineId , err = runtime . Uint64 ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "machine_id" , err )
}
msg , err := server . GetMachineRoute ( ctx , & protoReq )
return msg , metadata , err
}
var (
filter_HeadscaleService_EnableMachineRoutes_0 = & utilities . DoubleArray { Encoding : map [ string ] int { "machine_id" : 0 } , Base : [ ] int { 1 , 1 , 0 } , Check : [ ] int { 0 , 1 , 2 } }
)
func request_HeadscaleService_EnableMachineRoutes_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq EnableMachineRoutesRequest
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "machine_id" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "machine_id" )
}
protoReq . MachineId , err = runtime . Uint64 ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "machine_id" , err )
}
if err := req . ParseForm ( ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
if err := runtime . PopulateQueryParameters ( & protoReq , req . Form , filter_HeadscaleService_EnableMachineRoutes_0 ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := client . EnableMachineRoutes ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_EnableMachineRoutes_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq EnableMachineRoutesRequest
var metadata runtime . ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val , ok = pathParams [ "machine_id" ]
if ! ok {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "missing parameter %s" , "machine_id" )
}
protoReq . MachineId , err = runtime . Uint64 ( val )
if err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "type mismatch, parameter: %s, error: %v" , "machine_id" , err )
}
if err := req . ParseForm ( ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
if err := runtime . PopulateQueryParameters ( & protoReq , req . Form , filter_HeadscaleService_EnableMachineRoutes_0 ) ; err != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := server . EnableMachineRoutes ( ctx , & protoReq )
return msg , metadata , err
}
2022-01-25 23:11:15 +01:00
func request_HeadscaleService_CreateApiKey_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq CreateApiKeyRequest
var metadata runtime . ServerMetadata
newReader , berr := utilities . IOReaderFactory ( req . Body )
if berr != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , berr )
}
if err := marshaler . NewDecoder ( newReader ( ) ) . Decode ( & protoReq ) ; err != nil && err != io . EOF {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := client . CreateApiKey ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_CreateApiKey_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq CreateApiKeyRequest
var metadata runtime . ServerMetadata
newReader , berr := utilities . IOReaderFactory ( req . Body )
if berr != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , berr )
}
if err := marshaler . NewDecoder ( newReader ( ) ) . Decode ( & protoReq ) ; err != nil && err != io . EOF {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := server . CreateApiKey ( ctx , & protoReq )
return msg , metadata , err
}
func request_HeadscaleService_ExpireApiKey_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq ExpireApiKeyRequest
var metadata runtime . ServerMetadata
newReader , berr := utilities . IOReaderFactory ( req . Body )
if berr != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , berr )
}
if err := marshaler . NewDecoder ( newReader ( ) ) . Decode ( & protoReq ) ; err != nil && err != io . EOF {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := client . ExpireApiKey ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_ExpireApiKey_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq ExpireApiKeyRequest
var metadata runtime . ServerMetadata
newReader , berr := utilities . IOReaderFactory ( req . Body )
if berr != nil {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , berr )
}
if err := marshaler . NewDecoder ( newReader ( ) ) . Decode ( & protoReq ) ; err != nil && err != io . EOF {
return nil , metadata , status . Errorf ( codes . InvalidArgument , "%v" , err )
}
msg , err := server . ExpireApiKey ( ctx , & protoReq )
return msg , metadata , err
}
func request_HeadscaleService_ListApiKeys_0 ( ctx context . Context , marshaler runtime . Marshaler , client HeadscaleServiceClient , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq ListApiKeysRequest
var metadata runtime . ServerMetadata
msg , err := client . ListApiKeys ( ctx , & protoReq , grpc . Header ( & metadata . HeaderMD ) , grpc . Trailer ( & metadata . TrailerMD ) )
return msg , metadata , err
}
func local_request_HeadscaleService_ListApiKeys_0 ( ctx context . Context , marshaler runtime . Marshaler , server HeadscaleServiceServer , req * http . Request , pathParams map [ string ] string ) ( proto . Message , runtime . ServerMetadata , error ) {
var protoReq ListApiKeysRequest
var metadata runtime . ServerMetadata
msg , err := server . ListApiKeys ( ctx , & protoReq )
return msg , metadata , err
}
2021-11-04 23:07:59 +01:00
// RegisterHeadscaleServiceHandlerServer registers the http handlers for service HeadscaleService to "mux".
// UnaryRPC :call HeadscaleServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterHeadscaleServiceHandlerFromEndpoint instead.
func RegisterHeadscaleServiceHandlerServer ( ctx context . Context , mux * runtime . ServeMux , server HeadscaleServiceServer ) error {
mux . Handle ( "GET" , pattern_HeadscaleService_GetNamespace_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/GetNamespace" , runtime . WithHTTPPathPattern ( "/api/v1/namespace/{name}" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_GetNamespace_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2021-11-04 23:07:59 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_GetNamespace_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
mux . Handle ( "POST" , pattern_HeadscaleService_CreateNamespace_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/CreateNamespace" , runtime . WithHTTPPathPattern ( "/api/v1/namespace" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_CreateNamespace_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2021-11-04 23:07:59 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_CreateNamespace_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
mux . Handle ( "POST" , pattern_HeadscaleService_RenameNamespace_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/RenameNamespace" , runtime . WithHTTPPathPattern ( "/api/v1/namespace/{old_name}/rename/{new_name}" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_RenameNamespace_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2021-11-04 23:07:59 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_RenameNamespace_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
mux . Handle ( "DELETE" , pattern_HeadscaleService_DeleteNamespace_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/DeleteNamespace" , runtime . WithHTTPPathPattern ( "/api/v1/namespace/{name}" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_DeleteNamespace_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2021-11-04 23:07:59 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_DeleteNamespace_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
mux . Handle ( "GET" , pattern_HeadscaleService_ListNamespaces_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/ListNamespaces" , runtime . WithHTTPPathPattern ( "/api/v1/namespace" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_ListNamespaces_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2021-11-04 23:07:59 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_ListNamespaces_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
mux . Handle ( "POST" , pattern_HeadscaleService_CreatePreAuthKey_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/CreatePreAuthKey" , runtime . WithHTTPPathPattern ( "/api/v1/preauthkey" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_CreatePreAuthKey_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2021-11-04 23:07:59 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_CreatePreAuthKey_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
mux . Handle ( "POST" , pattern_HeadscaleService_ExpirePreAuthKey_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/ExpirePreAuthKey" , runtime . WithHTTPPathPattern ( "/api/v1/preauthkey/expire" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_ExpirePreAuthKey_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2021-11-04 23:07:59 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_ExpirePreAuthKey_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
mux . Handle ( "GET" , pattern_HeadscaleService_ListPreAuthKeys_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/ListPreAuthKeys" , runtime . WithHTTPPathPattern ( "/api/v1/preauthkey" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_ListPreAuthKeys_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2021-11-04 23:07:59 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_ListPreAuthKeys_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
mux . Handle ( "POST" , pattern_HeadscaleService_DebugCreateMachine_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/DebugCreateMachine" , runtime . WithHTTPPathPattern ( "/api/v1/debug/machine" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_DebugCreateMachine_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2021-11-04 23:07:59 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_DebugCreateMachine_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
mux . Handle ( "GET" , pattern_HeadscaleService_GetMachine_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/GetMachine" , runtime . WithHTTPPathPattern ( "/api/v1/machine/{machine_id}" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_GetMachine_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2021-11-04 23:07:59 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_GetMachine_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
2022-04-25 20:45:33 +02:00
mux . Handle ( "POST" , pattern_HeadscaleService_SetTags_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
2022-04-15 13:11:41 +02:00
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/SetTags" , runtime . WithHTTPPathPattern ( "/api/v1/machine/{machine_id}/tags" ) )
2022-04-15 13:11:41 +02:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_SetTags_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2022-04-15 13:11:41 +02:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2022-04-15 13:11:41 +02:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2022-04-15 13:11:41 +02:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_SetTags_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2022-04-15 13:11:41 +02:00
} )
2021-11-04 23:07:59 +01:00
mux . Handle ( "POST" , pattern_HeadscaleService_RegisterMachine_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/RegisterMachine" , runtime . WithHTTPPathPattern ( "/api/v1/machine/register" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_RegisterMachine_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2021-11-04 23:07:59 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_RegisterMachine_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
mux . Handle ( "DELETE" , pattern_HeadscaleService_DeleteMachine_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/DeleteMachine" , runtime . WithHTTPPathPattern ( "/api/v1/machine/{machine_id}" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_DeleteMachine_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2021-11-04 23:07:59 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_DeleteMachine_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
2021-11-21 14:40:04 +01:00
mux . Handle ( "POST" , pattern_HeadscaleService_ExpireMachine_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/ExpireMachine" , runtime . WithHTTPPathPattern ( "/api/v1/machine/{machine_id}/expire" ) )
2021-11-21 14:40:04 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_ExpireMachine_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2021-11-21 14:40:04 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-21 14:40:04 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-21 14:40:04 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_ExpireMachine_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-21 14:40:04 +01:00
} )
2022-03-13 22:03:20 +01:00
mux . Handle ( "POST" , pattern_HeadscaleService_RenameMachine_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/RenameMachine" , runtime . WithHTTPPathPattern ( "/api/v1/machine/{machine_id}/rename/{new_name}" ) )
2022-03-13 22:03:20 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_RenameMachine_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2022-03-13 22:03:20 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2022-03-13 22:03:20 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2022-03-13 22:03:20 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_RenameMachine_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2022-03-13 22:03:20 +01:00
} )
2021-11-04 23:07:59 +01:00
mux . Handle ( "GET" , pattern_HeadscaleService_ListMachines_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/ListMachines" , runtime . WithHTTPPathPattern ( "/api/v1/machine" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_ListMachines_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2021-11-04 23:07:59 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_ListMachines_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
2022-05-01 15:34:40 +02:00
mux . Handle ( "POST" , pattern_HeadscaleService_MoveMachine_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/MoveMachine" , runtime . WithHTTPPathPattern ( "/api/v1/machine/{machine_id}/namespace" ) )
2022-05-01 15:34:40 +02:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_MoveMachine_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2022-05-01 15:34:40 +02:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2022-05-01 15:34:40 +02:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2022-05-01 15:34:40 +02:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_MoveMachine_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2022-05-01 15:34:40 +02:00
} )
2021-11-04 23:07:59 +01:00
mux . Handle ( "GET" , pattern_HeadscaleService_GetMachineRoute_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
2021-10-29 18:43:10 +02:00
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/GetMachineRoute" , runtime . WithHTTPPathPattern ( "/api/v1/machine/{machine_id}/routes" ) )
2021-10-29 18:43:10 +02:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_GetMachineRoute_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2021-10-29 18:43:10 +02:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-10-29 18:43:10 +02:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-10-29 18:43:10 +02:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_GetMachineRoute_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-10-29 18:43:10 +02:00
} )
2021-11-04 23:07:59 +01:00
mux . Handle ( "POST" , pattern_HeadscaleService_EnableMachineRoutes_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
2021-10-29 18:43:10 +02:00
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/EnableMachineRoutes" , runtime . WithHTTPPathPattern ( "/api/v1/machine/{machine_id}/routes" ) )
2021-10-29 18:43:10 +02:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_EnableMachineRoutes_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2021-10-29 18:43:10 +02:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-10-29 18:43:10 +02:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-10-29 18:43:10 +02:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_EnableMachineRoutes_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-10-29 18:43:10 +02:00
} )
2022-01-25 23:11:15 +01:00
mux . Handle ( "POST" , pattern_HeadscaleService_CreateApiKey_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/CreateApiKey" , runtime . WithHTTPPathPattern ( "/api/v1/apikey" ) )
2022-01-25 23:11:15 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_CreateApiKey_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2022-01-25 23:11:15 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2022-01-25 23:11:15 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2022-01-25 23:11:15 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_CreateApiKey_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2022-01-25 23:11:15 +01:00
} )
mux . Handle ( "POST" , pattern_HeadscaleService_ExpireApiKey_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/ExpireApiKey" , runtime . WithHTTPPathPattern ( "/api/v1/apikey/expire" ) )
2022-01-25 23:11:15 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_ExpireApiKey_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2022-01-25 23:11:15 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2022-01-25 23:11:15 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2022-01-25 23:11:15 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_ExpireApiKey_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2022-01-25 23:11:15 +01:00
} )
mux . Handle ( "GET" , pattern_HeadscaleService_ListApiKeys_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
var stream runtime . ServerTransportStream
ctx = grpc . NewContextWithServerTransportStream ( ctx , & stream )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateIncomingContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/ListApiKeys" , runtime . WithHTTPPathPattern ( "/api/v1/apikey" ) )
2022-01-25 23:11:15 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := local_request_HeadscaleService_ListApiKeys_0 ( annotatedContext , inboundMarshaler , server , req , pathParams )
2022-01-25 23:11:15 +01:00
md . HeaderMD , md . TrailerMD = metadata . Join ( md . HeaderMD , stream . Header ( ) ) , metadata . Join ( md . TrailerMD , stream . Trailer ( ) )
2022-08-25 08:12:50 +02:00
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2022-01-25 23:11:15 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2022-01-25 23:11:15 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_ListApiKeys_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2022-01-25 23:11:15 +01:00
} )
2021-10-29 18:43:10 +02:00
return nil
}
// RegisterHeadscaleServiceHandlerFromEndpoint is same as RegisterHeadscaleServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterHeadscaleServiceHandlerFromEndpoint ( ctx context . Context , mux * runtime . ServeMux , endpoint string , opts [ ] grpc . DialOption ) ( err error ) {
conn , err := grpc . Dial ( endpoint , opts ... )
if err != nil {
return err
}
defer func ( ) {
if err != nil {
if cerr := conn . Close ( ) ; cerr != nil {
grpclog . Infof ( "Failed to close conn to %s: %v" , endpoint , cerr )
}
return
}
go func ( ) {
<- ctx . Done ( )
if cerr := conn . Close ( ) ; cerr != nil {
grpclog . Infof ( "Failed to close conn to %s: %v" , endpoint , cerr )
}
} ( )
} ( )
return RegisterHeadscaleServiceHandler ( ctx , mux , conn )
}
// RegisterHeadscaleServiceHandler registers the http handlers for service HeadscaleService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterHeadscaleServiceHandler ( ctx context . Context , mux * runtime . ServeMux , conn * grpc . ClientConn ) error {
return RegisterHeadscaleServiceHandlerClient ( ctx , mux , NewHeadscaleServiceClient ( conn ) )
}
// RegisterHeadscaleServiceHandlerClient registers the http handlers for service HeadscaleService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HeadscaleServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HeadscaleServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "HeadscaleServiceClient" to call the correct interceptors.
func RegisterHeadscaleServiceHandlerClient ( ctx context . Context , mux * runtime . ServeMux , client HeadscaleServiceClient ) error {
2021-11-04 23:07:59 +01:00
mux . Handle ( "GET" , pattern_HeadscaleService_GetNamespace_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
2021-10-29 18:43:10 +02:00
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/GetNamespace" , runtime . WithHTTPPathPattern ( "/api/v1/namespace/{name}" ) )
2021-10-29 18:43:10 +02:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_GetNamespace_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-10-29 18:43:10 +02:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-10-29 18:43:10 +02:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_GetNamespace_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-10-29 18:43:10 +02:00
} )
mux . Handle ( "POST" , pattern_HeadscaleService_CreateNamespace_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/CreateNamespace" , runtime . WithHTTPPathPattern ( "/api/v1/namespace" ) )
2021-10-29 18:43:10 +02:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_CreateNamespace_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-10-29 18:43:10 +02:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-10-29 18:43:10 +02:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_CreateNamespace_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-10-29 18:43:10 +02:00
} )
2021-11-04 23:07:59 +01:00
mux . Handle ( "POST" , pattern_HeadscaleService_RenameNamespace_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/RenameNamespace" , runtime . WithHTTPPathPattern ( "/api/v1/namespace/{old_name}/rename/{new_name}" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_RenameNamespace_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_RenameNamespace_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
2021-10-29 18:43:10 +02:00
mux . Handle ( "DELETE" , pattern_HeadscaleService_DeleteNamespace_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/DeleteNamespace" , runtime . WithHTTPPathPattern ( "/api/v1/namespace/{name}" ) )
2021-10-29 18:43:10 +02:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_DeleteNamespace_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-10-29 18:43:10 +02:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-10-29 18:43:10 +02:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_DeleteNamespace_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-10-29 18:43:10 +02:00
} )
mux . Handle ( "GET" , pattern_HeadscaleService_ListNamespaces_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/ListNamespaces" , runtime . WithHTTPPathPattern ( "/api/v1/namespace" ) )
2021-10-29 18:43:10 +02:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_ListNamespaces_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-10-29 18:43:10 +02:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-10-29 18:43:10 +02:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_ListNamespaces_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-10-29 18:43:10 +02:00
} )
2021-11-04 23:07:59 +01:00
mux . Handle ( "POST" , pattern_HeadscaleService_CreatePreAuthKey_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/CreatePreAuthKey" , runtime . WithHTTPPathPattern ( "/api/v1/preauthkey" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_CreatePreAuthKey_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_CreatePreAuthKey_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
mux . Handle ( "POST" , pattern_HeadscaleService_ExpirePreAuthKey_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/ExpirePreAuthKey" , runtime . WithHTTPPathPattern ( "/api/v1/preauthkey/expire" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_ExpirePreAuthKey_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_ExpirePreAuthKey_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
mux . Handle ( "GET" , pattern_HeadscaleService_ListPreAuthKeys_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/ListPreAuthKeys" , runtime . WithHTTPPathPattern ( "/api/v1/preauthkey" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_ListPreAuthKeys_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_ListPreAuthKeys_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
mux . Handle ( "POST" , pattern_HeadscaleService_DebugCreateMachine_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/DebugCreateMachine" , runtime . WithHTTPPathPattern ( "/api/v1/debug/machine" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_DebugCreateMachine_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_DebugCreateMachine_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
mux . Handle ( "GET" , pattern_HeadscaleService_GetMachine_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/GetMachine" , runtime . WithHTTPPathPattern ( "/api/v1/machine/{machine_id}" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_GetMachine_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_GetMachine_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
2022-04-25 20:45:33 +02:00
mux . Handle ( "POST" , pattern_HeadscaleService_SetTags_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
2022-04-15 13:11:41 +02:00
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/SetTags" , runtime . WithHTTPPathPattern ( "/api/v1/machine/{machine_id}/tags" ) )
2022-04-15 13:11:41 +02:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_SetTags_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2022-04-15 13:11:41 +02:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2022-04-15 13:11:41 +02:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_SetTags_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2022-04-15 13:11:41 +02:00
} )
2021-11-04 23:07:59 +01:00
mux . Handle ( "POST" , pattern_HeadscaleService_RegisterMachine_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/RegisterMachine" , runtime . WithHTTPPathPattern ( "/api/v1/machine/register" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_RegisterMachine_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_RegisterMachine_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
mux . Handle ( "DELETE" , pattern_HeadscaleService_DeleteMachine_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/DeleteMachine" , runtime . WithHTTPPathPattern ( "/api/v1/machine/{machine_id}" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_DeleteMachine_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_DeleteMachine_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
2021-11-21 14:40:04 +01:00
mux . Handle ( "POST" , pattern_HeadscaleService_ExpireMachine_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/ExpireMachine" , runtime . WithHTTPPathPattern ( "/api/v1/machine/{machine_id}/expire" ) )
2021-11-21 14:40:04 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_ExpireMachine_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-21 14:40:04 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-21 14:40:04 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_ExpireMachine_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-21 14:40:04 +01:00
} )
2022-03-13 22:03:20 +01:00
mux . Handle ( "POST" , pattern_HeadscaleService_RenameMachine_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/RenameMachine" , runtime . WithHTTPPathPattern ( "/api/v1/machine/{machine_id}/rename/{new_name}" ) )
2022-03-13 22:03:20 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_RenameMachine_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2022-03-13 22:03:20 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2022-03-13 22:03:20 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_RenameMachine_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2022-03-13 22:03:20 +01:00
} )
2021-11-04 23:07:59 +01:00
mux . Handle ( "GET" , pattern_HeadscaleService_ListMachines_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/ListMachines" , runtime . WithHTTPPathPattern ( "/api/v1/machine" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_ListMachines_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_ListMachines_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
2022-05-01 15:34:40 +02:00
mux . Handle ( "POST" , pattern_HeadscaleService_MoveMachine_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/MoveMachine" , runtime . WithHTTPPathPattern ( "/api/v1/machine/{machine_id}/namespace" ) )
2022-05-01 15:34:40 +02:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_MoveMachine_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2022-05-01 15:34:40 +02:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2022-05-01 15:34:40 +02:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_MoveMachine_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2022-05-01 15:34:40 +02:00
} )
2021-11-04 23:07:59 +01:00
mux . Handle ( "GET" , pattern_HeadscaleService_GetMachineRoute_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/GetMachineRoute" , runtime . WithHTTPPathPattern ( "/api/v1/machine/{machine_id}/routes" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_GetMachineRoute_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_GetMachineRoute_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
mux . Handle ( "POST" , pattern_HeadscaleService_EnableMachineRoutes_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/EnableMachineRoutes" , runtime . WithHTTPPathPattern ( "/api/v1/machine/{machine_id}/routes" ) )
2021-11-04 23:07:59 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_EnableMachineRoutes_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2021-11-04 23:07:59 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2021-11-04 23:07:59 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_EnableMachineRoutes_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2021-11-04 23:07:59 +01:00
} )
2022-01-25 23:11:15 +01:00
mux . Handle ( "POST" , pattern_HeadscaleService_CreateApiKey_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/CreateApiKey" , runtime . WithHTTPPathPattern ( "/api/v1/apikey" ) )
2022-01-25 23:11:15 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_CreateApiKey_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2022-01-25 23:11:15 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2022-01-25 23:11:15 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_CreateApiKey_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2022-01-25 23:11:15 +01:00
} )
mux . Handle ( "POST" , pattern_HeadscaleService_ExpireApiKey_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/ExpireApiKey" , runtime . WithHTTPPathPattern ( "/api/v1/apikey/expire" ) )
2022-01-25 23:11:15 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_ExpireApiKey_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2022-01-25 23:11:15 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2022-01-25 23:11:15 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_ExpireApiKey_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2022-01-25 23:11:15 +01:00
} )
mux . Handle ( "GET" , pattern_HeadscaleService_ListApiKeys_0 , func ( w http . ResponseWriter , req * http . Request , pathParams map [ string ] string ) {
ctx , cancel := context . WithCancel ( req . Context ( ) )
defer cancel ( )
inboundMarshaler , outboundMarshaler := runtime . MarshalerForRequest ( mux , req )
2022-08-25 08:12:50 +02:00
var err error
var annotatedContext context . Context
annotatedContext , err = runtime . AnnotateContext ( ctx , mux , req , "/headscale.v1.HeadscaleService/ListApiKeys" , runtime . WithHTTPPathPattern ( "/api/v1/apikey" ) )
2022-01-25 23:11:15 +01:00
if err != nil {
runtime . HTTPError ( ctx , mux , outboundMarshaler , w , req , err )
return
}
2022-08-25 08:12:50 +02:00
resp , md , err := request_HeadscaleService_ListApiKeys_0 ( annotatedContext , inboundMarshaler , client , req , pathParams )
annotatedContext = runtime . NewServerMetadataContext ( annotatedContext , md )
2022-01-25 23:11:15 +01:00
if err != nil {
2022-08-25 08:12:50 +02:00
runtime . HTTPError ( annotatedContext , mux , outboundMarshaler , w , req , err )
2022-01-25 23:11:15 +01:00
return
}
2022-08-25 08:12:50 +02:00
forward_HeadscaleService_ListApiKeys_0 ( annotatedContext , mux , outboundMarshaler , w , req , resp , mux . GetForwardResponseOptions ( ) ... )
2022-01-25 23:11:15 +01:00
} )
2021-10-29 18:43:10 +02:00
return nil
}
var (
2021-11-04 23:07:59 +01:00
pattern_HeadscaleService_GetNamespace_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 , 1 , 0 , 4 , 1 , 5 , 3 } , [ ] string { "api" , "v1" , "namespace" , "name" } , "" ) )
2021-10-29 18:43:10 +02:00
pattern_HeadscaleService_CreateNamespace_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 } , [ ] string { "api" , "v1" , "namespace" } , "" ) )
2021-11-04 23:07:59 +01:00
pattern_HeadscaleService_RenameNamespace_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 , 1 , 0 , 4 , 1 , 5 , 3 , 2 , 4 , 1 , 0 , 4 , 1 , 5 , 5 } , [ ] string { "api" , "v1" , "namespace" , "old_name" , "rename" , "new_name" } , "" ) )
pattern_HeadscaleService_DeleteNamespace_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 , 1 , 0 , 4 , 1 , 5 , 3 } , [ ] string { "api" , "v1" , "namespace" , "name" } , "" ) )
2021-10-29 18:43:10 +02:00
pattern_HeadscaleService_ListNamespaces_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 } , [ ] string { "api" , "v1" , "namespace" } , "" ) )
2021-11-04 23:07:59 +01:00
pattern_HeadscaleService_CreatePreAuthKey_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 } , [ ] string { "api" , "v1" , "preauthkey" } , "" ) )
pattern_HeadscaleService_ExpirePreAuthKey_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 , 2 , 3 } , [ ] string { "api" , "v1" , "preauthkey" , "expire" } , "" ) )
pattern_HeadscaleService_ListPreAuthKeys_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 } , [ ] string { "api" , "v1" , "preauthkey" } , "" ) )
pattern_HeadscaleService_DebugCreateMachine_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 , 2 , 3 } , [ ] string { "api" , "v1" , "debug" , "machine" } , "" ) )
pattern_HeadscaleService_GetMachine_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 , 1 , 0 , 4 , 1 , 5 , 3 } , [ ] string { "api" , "v1" , "machine" , "machine_id" } , "" ) )
2022-04-25 20:45:33 +02:00
pattern_HeadscaleService_SetTags_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 , 1 , 0 , 4 , 1 , 5 , 3 , 2 , 4 } , [ ] string { "api" , "v1" , "machine" , "machine_id" , "tags" } , "" ) )
2022-04-15 13:11:41 +02:00
2021-11-04 23:07:59 +01:00
pattern_HeadscaleService_RegisterMachine_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 , 2 , 3 } , [ ] string { "api" , "v1" , "machine" , "register" } , "" ) )
pattern_HeadscaleService_DeleteMachine_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 , 1 , 0 , 4 , 1 , 5 , 3 } , [ ] string { "api" , "v1" , "machine" , "machine_id" } , "" ) )
2021-11-21 14:40:04 +01:00
pattern_HeadscaleService_ExpireMachine_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 , 1 , 0 , 4 , 1 , 5 , 3 , 2 , 4 } , [ ] string { "api" , "v1" , "machine" , "machine_id" , "expire" } , "" ) )
2022-03-13 22:03:20 +01:00
pattern_HeadscaleService_RenameMachine_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 , 1 , 0 , 4 , 1 , 5 , 3 , 2 , 4 , 1 , 0 , 4 , 1 , 5 , 5 } , [ ] string { "api" , "v1" , "machine" , "machine_id" , "rename" , "new_name" } , "" ) )
2021-11-04 23:07:59 +01:00
pattern_HeadscaleService_ListMachines_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 } , [ ] string { "api" , "v1" , "machine" } , "" ) )
2022-05-01 15:34:40 +02:00
pattern_HeadscaleService_MoveMachine_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 , 1 , 0 , 4 , 1 , 5 , 3 , 2 , 4 } , [ ] string { "api" , "v1" , "machine" , "machine_id" , "namespace" } , "" ) )
2021-11-04 23:07:59 +01:00
pattern_HeadscaleService_GetMachineRoute_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 , 1 , 0 , 4 , 1 , 5 , 3 , 2 , 4 } , [ ] string { "api" , "v1" , "machine" , "machine_id" , "routes" } , "" ) )
pattern_HeadscaleService_EnableMachineRoutes_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 , 1 , 0 , 4 , 1 , 5 , 3 , 2 , 4 } , [ ] string { "api" , "v1" , "machine" , "machine_id" , "routes" } , "" ) )
2022-01-25 23:11:15 +01:00
pattern_HeadscaleService_CreateApiKey_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 } , [ ] string { "api" , "v1" , "apikey" } , "" ) )
pattern_HeadscaleService_ExpireApiKey_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 , 2 , 3 } , [ ] string { "api" , "v1" , "apikey" , "expire" } , "" ) )
pattern_HeadscaleService_ListApiKeys_0 = runtime . MustPattern ( runtime . NewPattern ( 1 , [ ] int { 2 , 0 , 2 , 1 , 2 , 2 } , [ ] string { "api" , "v1" , "apikey" } , "" ) )
2021-10-29 18:43:10 +02:00
)
var (
2021-11-04 23:07:59 +01:00
forward_HeadscaleService_GetNamespace_0 = runtime . ForwardResponseMessage
2021-10-29 18:43:10 +02:00
forward_HeadscaleService_CreateNamespace_0 = runtime . ForwardResponseMessage
2021-11-04 23:07:59 +01:00
forward_HeadscaleService_RenameNamespace_0 = runtime . ForwardResponseMessage
2021-10-29 18:43:10 +02:00
forward_HeadscaleService_DeleteNamespace_0 = runtime . ForwardResponseMessage
forward_HeadscaleService_ListNamespaces_0 = runtime . ForwardResponseMessage
2021-11-04 23:07:59 +01:00
forward_HeadscaleService_CreatePreAuthKey_0 = runtime . ForwardResponseMessage
forward_HeadscaleService_ExpirePreAuthKey_0 = runtime . ForwardResponseMessage
forward_HeadscaleService_ListPreAuthKeys_0 = runtime . ForwardResponseMessage
forward_HeadscaleService_DebugCreateMachine_0 = runtime . ForwardResponseMessage
forward_HeadscaleService_GetMachine_0 = runtime . ForwardResponseMessage
2022-04-25 20:45:33 +02:00
forward_HeadscaleService_SetTags_0 = runtime . ForwardResponseMessage
2022-04-15 13:11:41 +02:00
2021-11-04 23:07:59 +01:00
forward_HeadscaleService_RegisterMachine_0 = runtime . ForwardResponseMessage
forward_HeadscaleService_DeleteMachine_0 = runtime . ForwardResponseMessage
2021-11-21 14:40:04 +01:00
forward_HeadscaleService_ExpireMachine_0 = runtime . ForwardResponseMessage
2022-03-13 22:03:20 +01:00
forward_HeadscaleService_RenameMachine_0 = runtime . ForwardResponseMessage
2021-11-04 23:07:59 +01:00
forward_HeadscaleService_ListMachines_0 = runtime . ForwardResponseMessage
2022-05-01 15:34:40 +02:00
forward_HeadscaleService_MoveMachine_0 = runtime . ForwardResponseMessage
2021-11-04 23:07:59 +01:00
forward_HeadscaleService_GetMachineRoute_0 = runtime . ForwardResponseMessage
forward_HeadscaleService_EnableMachineRoutes_0 = runtime . ForwardResponseMessage
2022-01-25 23:11:15 +01:00
forward_HeadscaleService_CreateApiKey_0 = runtime . ForwardResponseMessage
forward_HeadscaleService_ExpireApiKey_0 = runtime . ForwardResponseMessage
forward_HeadscaleService_ListApiKeys_0 = runtime . ForwardResponseMessage
2021-10-29 18:43:10 +02:00
)