keeper

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 8 Imported by: 0

README

goutils/v2/keeper

The keeper package is a collection of utility functions designed to simplify common keeper tasks.

Table of contents:


Functions

CommanderInstalled
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.


LoggedIn
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.


RetrieveRecord
RetrieveRecord(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.


SearchRecords
SearchRecords(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.


Installation

To use the goutils/v2/keeper package, you first need to install it. Follow the steps below to install via go get.

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

Usage

After installation, you can import the package in your Go project using the following import statement:

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

Tests

To ensure the package is working correctly, run the following command to execute the tests for goutils/v2/keeper:

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

Examples

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
package main

import (
	"log"

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

func main() {
	if !keeper.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
package main

import (
	"log"

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

func main() {
	if !keeper.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
package main

import (
	"log"

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

func main() {
	uid, err := keeper.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.

**Attributes:**

UID: A unique identifier. Title: Title of the record. URL: The associated URL of the record. Username: The username associated with the record. Password: The password associated with the record. TOTP: Time-based One-Time Password. Note: Additional note associated with the record.

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
package main

import (
	"log"

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

func main() {
	record, err := keeper.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