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

Method File

pkg/fetch/basepath.go:26–36  ·  view source on GitHub ↗
(pathElements ...string)

Source from the content-addressed store, hash-verified

24}
25
26func (f basePathFetcher) File(pathElements ...string) ([]byte, error) {
27 if len(pathElements) == 0 {
28 return nil, errFilenameNotSpecified.New()
29 }
30
31 // NOTE: filepath.IsAbs returns true for paths starting with '/' on all supported operating systems.
32 if filepath.IsAbs(pathElements[0]) {
33 return f.Interface.File(pathElements...)
34 }
35 return f.Interface.File(append(f.basePath, pathElements...)...)
36}
37
38// WithBasePath returns an Interface, which preprends basePath to non-absolute requested paths.
39func WithBasePath(f Interface, basePath ...string) Interface {

Callers

nothing calls this directly

Calls 2

NewMethod · 0.65
FileMethod · 0.65

Tested by

no test coverage detected