This repository has been archived by the owner on Apr 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
gcmurphy/getpass
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Getpass for GO. Leverages the good work from the people over at OpenSSL.org via cgo to provide a simple, and cross platform getpass implementation. The API provided essentially wraps the UI_UTIL_read_pw_string function call in <openssl/ui.h>. // Prompt the user for their password. func GetPass()(pw string, e os.Error) // Prompt the user for their password, and get them to confirm it. func GetPassConfirm()(pw string, e os.Error) // Full customization of the call. Arugments essentially map to UI_UTIL_read_pw_string func GetPassWithOptions(prompt string, confirm, max int)(pw string, e os.Error) Example Usage: package main import ( "os" "fmt" "github.com/gcmurphy/getpass" ) func main(){ fmt.Println("Use default prompt:") pw,e := getpass.GetPass() if e != nil { fmt.Println("ERROR: ", e.Error()) os.Exit(1) } fmt.Println("Password = ", pw) } Install: * Requires: OpenSSL * go get * go build
About
Portable getpass implementation for golang
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published