Documentation ¶
Overview ¶
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 ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.