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

Function Example

pkg/fetch/fetch_test.go:24–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22)
23
24func Example() {
25 fetcher, err := fetch.FromHTTP(http.DefaultClient, "http://webserver.thethings.network/repository")
26 if err != nil {
27 panic(err)
28 }
29 content, err := fetcher.File("README.md")
30 if err != nil {
31 panic(err)
32 }
33
34 fmt.Println("Content of http://webserver.thethings.network/repository/README.md:")
35 fmt.Println(string(content))
36}

Callers

nothing calls this directly

Calls 2

FromHTTPFunction · 0.92
FileMethod · 0.65

Tested by

no test coverage detected