diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-02-27 15:46:56 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-02-27 15:46:56 +0100 |
| commit | 6f8e016fcff9c1c47474b6c0b6c3c09d37d64e1a (patch) | |
| tree | aa2e0a80af8b151737a3375943a4858ad66ea383 /internal/discovery/discovery_embed.go | |
| parent | 92e437148078466cd949df7043330b78ae0ff65f (diff) | |
Discovery: Conditionally embed latest discovery files for local cache
Conditionally embedding based on
https://github.com/golang/go/issues/44484#issuecomment-948137497
To use it, wget the discovery files into the internal/discovery
folder (same JSON name) after verifying the signature. Then build with -tags=release
Diffstat (limited to 'internal/discovery/discovery_embed.go')
| -rw-r--r-- | internal/discovery/discovery_embed.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/discovery/discovery_embed.go b/internal/discovery/discovery_embed.go new file mode 100644 index 0000000..efd85dd --- /dev/null +++ b/internal/discovery/discovery_embed.go @@ -0,0 +1,20 @@ +//go:build release +// +build release + +package discovery + +import _ "embed" + +// eServers are the embedded server list +// +//go:embed server_list.json +var eServers []byte + +// eOrganizations are the embedded organizations +// +//go:embed organization_list.json +var eOrganizations []byte + +func init() { + HasCache = true +} |
