cloud.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package fyne
  2. // CloudProvider specifies the identifying information of a cloud provider.
  3. // This information is mostly used by the `fyne.io/cloud ShowSettings' user flow.
  4. //
  5. // Since: 2.3
  6. type CloudProvider interface {
  7. // ProviderDescription returns a more detailed description of this cloud provider.
  8. ProviderDescription() string
  9. // ProviderIcon returns an icon resource that is associated with the given cloud service.
  10. ProviderIcon() Resource
  11. // ProviderName returns the name of this cloud provider, usually the name of the service it uses.
  12. ProviderName() string
  13. // Cleanup is called when this provider is no longer used and should be disposed.
  14. // This is guaranteed to execute before a new provider is `Setup`
  15. Cleanup(App)
  16. // Setup is called when this provider is being used for the first time.
  17. // Returning an error will exit the cloud setup process, though it can be retried.
  18. Setup(App) error
  19. }
  20. // CloudProviderPreferences interface defines the functionality that a cloud provider will include if it is capable
  21. // of synchronizing user preferences.
  22. //
  23. // Since: 2.3
  24. type CloudProviderPreferences interface {
  25. // CloudPreferences returns a preference provider that will sync values to the cloud this provider uses.
  26. CloudPreferences(App) Preferences
  27. }
  28. // CloudProviderStorage interface defines the functionality that a cloud provider will include if it is capable
  29. // of synchronizing user documents.
  30. //
  31. // Since: 2.3
  32. type CloudProviderStorage interface {
  33. // CloudStorage returns a storage provider that will sync documents to the cloud this provider uses.
  34. CloudStorage(App) Storage
  35. }