noassets.go 744 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (C) 2021 The Syncthing Authors.
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  5. // You can obtain one at https://mozilla.org/MPL/2.0/.
  6. //go:build noassets
  7. // +build noassets
  8. package auto
  9. import (
  10. "bytes"
  11. "compress/gzip"
  12. "github.com/syncthing/syncthing/lib/assets"
  13. )
  14. func Assets() map[string]assets.Asset {
  15. // Return a minimal index.html and nothing else, to allow the trivial
  16. // test to pass.
  17. buf := new(bytes.Buffer)
  18. gw := gzip.NewWriter(buf)
  19. _, _ = gw.Write([]byte("<html></html>"))
  20. _ = gw.Flush()
  21. return map[string]assets.Asset{
  22. "default/index.html": {
  23. Gzipped: true,
  24. Content: buf.String(),
  25. },
  26. }
  27. }