Registry / auth / 99designs-go-keychain

99designs-go-keychain

JSON →
library0.0.0-20191008050251-8e49817e8af4gogounverified

Package keychain provides a Go interface to the macOS Keychain for secure credential storage.

go get github.com/99designs/go-keychain
INSTALL
IMPORT
SIG · 99DESIGNS-GO-KEYCH
9
99designs-go-keychain
authgov0.0.0-20191008050251-8e49817e8af4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

keychain
github.com/99designs/go-keychain

Add a password to the macOS Keychain.

package main import ( "fmt" "github.com/99designs/go-keychain" ) func main() { item := keychain.NewItem() item.SetSecClass(keychain.SecClassGenericPassword) item.SetService("MyService") item.SetAccount("user") item.SetData([]byte("secret")) err := keychain.AddItem(item) if err != nil { fmt.Println(err) } }
Debug
Known issues
gotchaThis package only works on macOS; it will not compile on other platforms.
fix
Use build tags or conditional compilation to restrict usage to darwin.
affects: all
Upgrade
Version history
0.0.0-20191008050251-8e49817e8af4latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
42 hits · last 30 days
node
32
Resources
99designs-go-keychain — go get 99designs-go-keychain · libregistry