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

Method assetURL

pkg/devicerepository/grpc.go:42–47  ·  view source on GitHub ↗
(brandID, path string)

Source from the content-addressed store, hash-verified

40}
41
42func (dr *DeviceRepository) assetURL(brandID, path string) string {
43 if path == "" || dr.config.AssetsBaseURL == "" || strings.HasPrefix(path, dr.config.AssetsBaseURL) {
44 return path
45 }
46 return fmt.Sprintf("%s/vendor/%s/%s", strings.TrimRight(dr.config.AssetsBaseURL, "/"), brandID, path)
47}
48
49// ensureBaseAssetURLs prepends the BaseAssetURL to model assets.
50func (dr *DeviceRepository) ensureBaseAssetURLs(models []*ttnpb.EndDeviceModel) {

Callers 3

ensureBaseAssetURLsMethod · 0.95
ListBrandsMethod · 0.95
GetBrandMethod · 0.95

Calls 1

HasPrefixMethod · 0.45

Tested by

no test coverage detected