mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-02 03:33:05 +00:00
Remove grpc share/unshare functions
This commit is contained in:
parent
9ceac5c0fc
commit
6da2a19d10
1 changed files with 0 additions and 44 deletions
44
grpcv1.go
44
grpcv1.go
|
@ -262,50 +262,6 @@ func (api headscaleV1APIServer) ListMachines(
|
||||||
return &v1.ListMachinesResponse{Machines: response}, nil
|
return &v1.ListMachinesResponse{Machines: response}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (api headscaleV1APIServer) ShareMachine(
|
|
||||||
ctx context.Context,
|
|
||||||
request *v1.ShareMachineRequest,
|
|
||||||
) (*v1.ShareMachineResponse, error) {
|
|
||||||
destinationNamespace, err := api.h.GetNamespace(request.GetNamespace())
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
machine, err := api.h.GetMachineByID(request.GetMachineId())
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
err = api.h.AddSharedMachineToNamespace(machine, destinationNamespace)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &v1.ShareMachineResponse{Machine: machine.toProto()}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (api headscaleV1APIServer) UnshareMachine(
|
|
||||||
ctx context.Context,
|
|
||||||
request *v1.UnshareMachineRequest,
|
|
||||||
) (*v1.UnshareMachineResponse, error) {
|
|
||||||
destinationNamespace, err := api.h.GetNamespace(request.GetNamespace())
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
machine, err := api.h.GetMachineByID(request.GetMachineId())
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
err = api.h.RemoveSharedMachineFromNamespace(machine, destinationNamespace)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &v1.UnshareMachineResponse{Machine: machine.toProto()}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (api headscaleV1APIServer) GetMachineRoute(
|
func (api headscaleV1APIServer) GetMachineRoute(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
request *v1.GetMachineRouteRequest,
|
request *v1.GetMachineRouteRequest,
|
||||||
|
|
Loading…
Reference in a new issue