MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / Get

Method Get

pkg/gatewayserver/is.go:96–112  ·  view source on GitHub ↗

Get implements EntityRegistry.

(ctx context.Context, req *ttnpb.GetGatewayRequest)

Source from the content-addressed store, hash-verified

94
95// Get implements EntityRegistry.
96func (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.
115func (is IS) UpdateAntennas(ctx context.Context, ids *ttnpb.GatewayIdentifiers, antennas []*ttnpb.GatewayAntenna) error {

Callers

nothing calls this directly

Calls 8

newRegistryClientMethod · 0.95
WithForwardedAuthFunction · 0.92
IsUnauthenticatedFunction · 0.92
getAuthenticatedContextFunction · 0.85
WithClusterAuthMethod · 0.65
GetMethod · 0.65
GetGatewayIdsMethod · 0.45

Tested by

no test coverage detected