package cloud
import "fyne.io/cloud"
Package cloud provides various cloud provider implementations and utilities to add the cloud services into your Fyne app. Developers can choose to load a specific provider, or they can present a configuration user interface allowing the end-user to choose the provider they wish to use.
A simple usage where an app uses AWS for cloud provision may look like this:
package main import ( "fyne.io/cloud/provider/aws" "fyne.io/fyne/v2/app" "fyne.io/fyne/v2/widget" ) func main() { a := app.New() a.SetCloudProvider(aws.NewProvider()) // if aws provider existed ;) w := a.NewWindow("Cloud") w.SetContent(widget.NewLabel("Add content here")) w.ShowAndRun() }
Alternatively to allow the user to choose a cloud provider for their storage etc use:
package main import ( "fyne.io/cloud" "fyne.io/fyne/v2/app" "fyne.io/fyne/v2/widget" ) func main() { a := app.New() cloud.Enable(a) w := a.NewWindow("Cloud") w.SetContent(widget.NewButton("Choose cloud provider", func() { cloud.ShowSettings(a, w) })) w.ShowAndRun() }
Index ¶
- func Enable(a fyne.App)
- func Register(p fyne.CloudProvider)
- func ShowSettings(a fyne.App, w fyne.Window)
- type Configurable
- type Disconnectable
Functions ¶
func Enable ¶
func Enable(a fyne.App)
func Register ¶
func Register(p fyne.CloudProvider)
func ShowSettings ¶
func ShowSettings(a fyne.App, w fyne.Window)
Types ¶
type Configurable ¶
type Configurable interface { // Configure requests that the cloud provider show some configuration options as a dialog on the specified window. // It returns a serialised configuration or an error. Configure(fyne.App, fyne.Window) (string, error) // SetConfig is used to apply a previous configuration to this provider. SetConfig(string) }
Configurable interface describes the functions required for a cloud provider to store configuration.
type Disconnectable ¶
type Disconnectable interface { // Disconnect the cloud provider from application and ignore future events. Disconnect() }
Disconnectable interface describes a cloud provider that can respond to being disconnected. This is typically used before a replacement provider is loaded.
Source Files ¶
cloud.go config.go settings.go
Directories ¶
Path | Synopsis |
---|---|
example | |
internal | This file is copied from fyne.io/fyne/internal to avoid an import loop |
provider | |
provider/dropbox |
- Version
- v0.0.0-20230911143224-fc981eeacb77 (latest)
- Published
- Sep 11, 2023
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 1 month ago –
Tools for package owners.