Golang client for LastPass
MIT License
https://pkg.go.dev/github.com/ansd/lastpass-go
Install:
$ go get github.com/ansd/lastpass-go
Import:
import "github.com/ansd/lastpass-go"
Below, error handling is excluded for brevity.
See examples directory for more examples.
// authenticate with LastPass servers
client, _ := lastpass.NewClient(context.Background(), "user name", "master password")
// two-factor authentication with one-time password as second factor:
// client, _ := lastpass.NewClient(context.Background(), "user name", "master password", lastpass.WithOneTimePassword("123456"))
account := &lastpass.Account{
Name: "my site",
Username: "my user",
Password: "my pwd",
URL: "https://myURL",
Group: "my group",
Notes: "my notes",
}
// Add() account
client.Add(context.Background(), account)
// read all Accounts()
accounts, _ := client.Accounts(context.Background())
// Update() account
account.Password = "updated password"
client.Update(context.Background(), account)
// Delete() account
client.Delete(context.Background(), account)
// Logout()
client.Logout(context.Background())
This repository is a port of detunized/lastpass-ruby and a clone of mattn/lastpass-go.
This project is licensed under the MIT License - see the LICENSE file for details.
This repository's ecb
(Electronic Codebook) package contains code which is "Copyright 2013 The Go Authors. All rights reserved."