keeper

package
v2.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2023 License: MIT Imports: 9 Imported by: 0

README

goutils/v2/keeper

The keeper package is a part of goutils library.

It provides utility functions for interfacing with the Keeper password manager in Go.


Functions

CommanderInstalled
func CommanderInstalled() bool

Check if the Keeper Commander tool is installed on the current system.

LoggedIn
func LoggedIn() bool

Check if the user is logged in to Keeper.

RetrieveRecord
func RetrieveRecord(keeperUID string) (Record, error)

Retrieves a user's Keeper record using the provided unique identifier (keeperUID).

SearchRecords
func SearchRecords(searchTerm string) (string, error)

Searches the user's Keeper records for records that match the provided search term.


Installation

To use the goutils/v2/keeper package, you need to install it via go get:

go get github.com/l50/goutils/v2/keeper

Usage

After installation, you can import it in your project:

import "github.com/l50/goutils/v2/keeper"

Tests

To run the tests for the goutils/v2/keeper package, navigate to your $GOPATH/src/github.com/l50/goutils/v2/keeper directory and run go test:

go test -v

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.


License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommanderInstalled

func CommanderInstalled() bool

CommanderInstalled checks if the Keeper Commander tool is installed on the current system.

Returns:

bool: True if the Keeper Commander tool is installed, false otherwise.

Example:

if !CommanderInstalled() {
  log.Fatal("Keeper Commander is not installed.")
}

func LoggedIn

func LoggedIn() bool

LoggedIn checks if the user is logged into their Keeper vault.

Returns:

bool: True if the user is logged into their Keeper vault, false otherwise.

Example:

if !LoggedIn() {
  log.Fatal("Not logged into Keeper vault.")
}

func SearchRecords

func SearchRecords(searchTerm string) (string, error)

SearchRecords searches the user's Keeper records for records that match the provided search term.

Parameters:

searchTerm: A string representing the term to search for in the Keeper records.

Returns:

string: The unique identifier (UID) of the first Keeper record that matches the search term. error: An error if the Keeper records cannot be searched or if the search term does not match any records.

Example:

uid, err := SearchRecords("search term")

if err != nil {
  log.Fatalf("Failed to search records: %v", err)
}

log.Printf("Found matching record with UID: %s\n", uid)

Types

type Record

type Record struct {
	UID      string
	Title    string
	URL      string
	Username string
	Password string
	TOTP     string
	Note     string
}

Record represents a user's record in the Keeper application. Each record includes a unique identifier (UID), title, URL, username, password, TOTP, and a note.

func RetrieveRecord

func RetrieveRecord(keeperUID string) (Record, error)

RetrieveRecord retrieves a user's Keeper record using the provided unique identifier (keeperUID).

Parameters:

keeperUID: A string representing the unique identifier of the Keeper record to retrieve.

Returns:

Record: The retrieved Keeper record. error: An error if the Keeper record cannot be retrieved.

Example:

record, err := RetrieveRecord("1234abcd")

if err != nil {
  log.Fatalf("Failed to retrieve record: %v", err)
}

log.Printf("Retrieved record: %+v\n", record)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL