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

Function GetLatest

pkg/band/all.go:273–287  ·  view source on GitHub ↗

GetLatest returns the latest version of the band if it was found, and returns an error otherwise.

(id string)

Source from the content-addressed store, hash-verified

271// GetLatest returns the latest version of the band if it was found,
272// and returns an error otherwise.
273func GetLatest(id string) (Band, error) {
274 versions, ok := All[id]
275 if !ok {
276 return Band{}, errBandNotFound.WithAttributes("id", id, "version", "latest")
277 }
278 latestVersion, ok := LatestVersion[id]
279 if !ok {
280 return Band{}, errBandNotFound.WithAttributes("id", id, "version", "latest")
281 }
282 band, ok := versions[latestVersion]
283 if !ok {
284 return Band{}, errBandNotFound.WithAttributes("id", id, "version", latestVersion)
285 }
286 return band, nil
287}

Callers 15

toPBFrequencyPlanFunction · 0.92
NewSchedulerFunction · 0.92
NewConnectionFunction · 0.92
buildLoRaGatewayConfigFunction · 0.92
toUplinkMessageMethod · 0.92
FromUplinkMessageMethod · 0.92
toUplinkMessageMethod · 0.92
FromUplinkMessageMethod · 0.92
FromDownlinkMethod · 0.92
ToDownlinkMessageMethod · 0.92
ValidateMethod · 0.92

Calls 1

WithAttributesMethod · 0.45

Tested by 2

TestRx1DataRateFunction · 0.68