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.")
}
}
Output:
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.")
}
}
Output:
func SearchRecords ¶
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)
}
Output:
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 ¶
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)
}
Output: