-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreferences.go
More file actions
28 lines (24 loc) · 804 Bytes
/
Copy pathpreferences.go
File metadata and controls
28 lines (24 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package main
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/dialog"
)
type Preferences struct {
Bucket string
Endpoint string
Region string
Id string
Token string
ExpireIn int
ShortService string
}
func (p Preferences) SaveData(myApp fyne.App, myWindow fyne.Window) {
myApp.Preferences().SetString("BUCKET_NAME", p.Bucket)
myApp.Preferences().SetString("AWS_ACCESS_KEY_ID", p.Id)
myApp.Preferences().SetString("AWS_ENDPOINT", p.Endpoint)
myApp.Preferences().SetString("AWS_SECRET_ACCESS_KEY", p.Token)
myApp.Preferences().SetString("AWS_REGION", p.Region)
myApp.Preferences().SetInt("EXPIRE_IN", p.ExpireIn)
myApp.Preferences().SetString("SHORT_SERVICE", p.ShortService)
dialog.ShowInformation("Save Success", "Data save successfully!", myWindow)
}