Begin implementation of formatted barcodes
This commit is contained in:
1
formatting/format.go
Normal file
1
formatting/format.go
Normal file
@@ -0,0 +1 @@
|
||||
package formatting
|
||||
8
formatting/vcard.go
Normal file
8
formatting/vcard.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package formatting
|
||||
|
||||
type Vcard struct {
|
||||
FirstName string
|
||||
Surname string
|
||||
Mobile string
|
||||
Home string
|
||||
}
|
||||
23
formatting/wifi.go
Normal file
23
formatting/wifi.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user