db

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagDbDefault     = "tooltracker.db"
	FlagDbDescription = "path to sqlite3 file to create/use"
)

Variables

This section is empty.

Functions

func NormalizeStringP

func NormalizeStringP(s *string) *string

Represent "" as nil, and trim spaces.

Types

type Alias

type Alias struct {
	DelegatedEmail *string
	Email          string
	Alias          string
}

func (Alias) String

func (a Alias) String() string

type DB

type DB struct{ *sql.DB }

func CommonInit

func CommonInit(t *testing.T) DB

func Open

func Open(path string) (DB, error)

func (*DB) Close

func (db *DB) Close()

func (DB) EnsureTooltrackerTables

func (db DB) EnsureTooltrackerTables() error

func (DB) GetDelegatedEmailFor

func (db DB) GetDelegatedEmailFor(from string) string

func (DB) GetItems

func (db DB) GetItems(filter tags.Tags) []Item

func (DB) GetTool

func (db DB) GetTool(name string) (tool Tool)

func (DB) UpdateAlias

func (db DB) UpdateAlias(alias Alias)

func (DB) UpdateLocation

func (db DB) UpdateLocation(location Location)

func (DB) UpdateTags

func (db DB) UpdateTags(tool string, tags tags.Tags)

func (DB) UpdateTool

func (db DB) UpdateTool(tool Tool)

type Item

type Item struct {
	Tags        *[]string
	Description *string
	Alias       *string
	Location
}

func (Item) String

func (i Item) String() string

type Location

type Location struct {
	Comment    *string
	Tool       string
	LastSeenBy string
}

func (Location) String

func (l Location) String() string

type Tool

type Tool struct {
	Description *string
	Tags        tags.Tags
	Name        string
	Image       string
}

func (Tool) String

func (t Tool) String() string

Jump to

Keyboard shortcuts

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