mocked_discovery_test.go 997 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright (C) 2016 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. package api
  7. import (
  8. "context"
  9. "github.com/syncthing/syncthing/lib/discover"
  10. "github.com/syncthing/syncthing/lib/protocol"
  11. )
  12. type mockedCachingMux struct{}
  13. // from suture.Service
  14. func (m *mockedCachingMux) Serve(ctx context.Context) error {
  15. select {}
  16. }
  17. // from events.Finder
  18. func (m *mockedCachingMux) Lookup(ctx context.Context, deviceID protocol.DeviceID) (direct []string, err error) {
  19. return nil, nil
  20. }
  21. func (m *mockedCachingMux) Error() error {
  22. return nil
  23. }
  24. func (m *mockedCachingMux) String() string {
  25. return "mockedCachingMux"
  26. }
  27. func (m *mockedCachingMux) Cache() map[protocol.DeviceID]discover.CacheEntry {
  28. return nil
  29. }
  30. // from events.Manager
  31. func (m *mockedCachingMux) ChildErrors() map[string]error {
  32. return nil
  33. }