Get implements EntityRegistry.
(ctx context.Context, req *ttnpb.GetGatewayRequest)
| 94 | |
| 95 | // Get implements EntityRegistry. |
| 96 | func (is IS) Get(ctx context.Context, req *ttnpb.GetGatewayRequest) (*ttnpb.Gateway, error) { |
| 97 | ctx, err := getAuthenticatedContext(ctx) |
| 98 | if err != nil { |
| 99 | return nil, err |
| 100 | } |
| 101 | callOpt, err := rpcmetadata.WithForwardedAuth(ctx, is.AllowInsecureForCredentials()) |
| 102 | if errors.IsUnauthenticated(err) { |
| 103 | callOpt = is.WithClusterAuth() |
| 104 | } else if err != nil { |
| 105 | return nil, err |
| 106 | } |
| 107 | registry, err := is.newRegistryClient(ctx, req.GetGatewayIds()) |
| 108 | if err != nil { |
| 109 | return nil, err |
| 110 | } |
| 111 | return registry.Get(ctx, req, callOpt) |
| 112 | } |
| 113 | |
| 114 | // UpdateAntennas updates the gateway antennas. |
| 115 | func (is IS) UpdateAntennas(ctx context.Context, ids *ttnpb.GatewayIdentifiers, antennas []*ttnpb.GatewayAntenna) error { |
nothing calls this directly
no test coverage detected