Documentation ¶
Index ¶
- Constants
- Variables
- func Errorf(format string, a ...interface{}) error
- func HashIt(s string) ([]byte, error)
- func MatchingHash(pword string) (bool, error)
- func PkgErrorf(pkg string, format string, a ...interface{}) error
- func PkgSprintf(pkg string, format string, a ...interface{}) string
- func PrintMapSorted(m map[string]interface{})
- func ReadSsidsFile() ([]string, error)
- func RemoveFlagFile(path string) error
- func RunningOn(address string) bool
- func SetHashFile(p string)
- func SetSsidsFile(p string)
- func Sprintf(format string, a ...interface{}) string
- func WriteFlagFile(path string) error
Constants ¶
const (
// FmtPrefix to be included in all log traces
FmtPrefix = "== wifi-connect"
)
Variables ¶
var HashFile = filepath.Join(os.Getenv("SNAP_COMMON"), "hash")
HashFile is the path to the file that stores the hash of the portals password
var SsidsFile = filepath.Join(os.Getenv("SNAP_COMMON"), "ssids")
SsidsFile path to the file filled by daemon with available ssids in csv format
Functions ¶
func Errorf ¶
Errorf returns a new instance implementing error interface taken a formatted string and params as input
func HashIt ¶
HashIt writes the hash of the passed password to the HashFile and returns the hash and error
func MatchingHash ¶
MatchingHash verifies the passed password against the saved hash, returng true if they match, else false
func PkgErrorf ¶
PkgErrorf returns a new instance implementing error interface taken a formatted string and params as input
func PkgSprintf ¶
PkgSprintf returns a formatted string with project prefix
func PrintMapSorted ¶
func PrintMapSorted(m map[string]interface{})
PrintMapSorted prints to stdout a map sorting content by keys
func ReadSsidsFile ¶
ReadSsidsFile read the ssids file, if any
func RemoveFlagFile ¶
RemoveFlagFile removes passed flag file
Types ¶
This section is empty.