Get returns the band if it was found, and returns an error otherwise.
(id string, version ttnpb.PHYVersion)
| 257 | |
| 258 | // Get returns the band if it was found, and returns an error otherwise. |
| 259 | func Get(id string, version ttnpb.PHYVersion) (Band, error) { |
| 260 | versions, ok := All[id] |
| 261 | if !ok { |
| 262 | return Band{}, errBandNotFound.WithAttributes("id", id, "version", version) |
| 263 | } |
| 264 | band, ok := versions[version] |
| 265 | if !ok { |
| 266 | return Band{}, errBandNotFound.WithAttributes("id", id, "version", version) |
| 267 | } |
| 268 | return band, nil |
| 269 | } |
| 270 | |
| 271 | // GetLatest returns the latest version of the band if it was found, |
| 272 | // and returns an error otherwise. |