24 lines
409 B
Go
24 lines
409 B
Go
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
|
|
}
|