Begin implementation of formatted barcodes

This commit is contained in:
Fred Boniface
2023-09-02 22:05:46 +01:00
parent d3bd2673e8
commit 4dad1406eb
9 changed files with 87 additions and 4 deletions

1
formatting/format.go Normal file
View File

@@ -0,0 +1 @@
package formatting

8
formatting/vcard.go Normal file
View File

@@ -0,0 +1,8 @@
package formatting
type Vcard struct {
FirstName string
Surname string
Mobile string
Home string
}

23
formatting/wifi.go Normal file
View File

@@ -0,0 +1,23 @@
package formatting
import "fmt"
type Encryption string
const (
WEP Encryption = "wep"
WPA Encryption = "wpa"
None Encryption = ""
)
type WiFi struct {
Ssid string
Password string
Hidden bool
Encryption Encryption
}
func FormatWiFi(input WiFi) string {
content := fmt.Sprintf("WIFI:T:%s;S:%s;P:%s;H:%t;", input.Encryption, input.Ssid, input.Password, input.Hidden)
return content
}