db

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 5 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 {
	Email          string
	Alias          string
	DelegatedEmail *string
}

func (Alias) String

func (a Alias) String() string

type DB

type DB struct{ *sql.DB }

func Open

func Open(path string) (DB, error)

func (DB) GetDelegatedEmailFor

func (db DB) GetDelegatedEmailFor(from string) string

func (DB) GetItems

func (db DB) GetItems() []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) UpdateTool

func (db DB) UpdateTool(tool Tool)

type Item

type Item struct {
	Location
	Description *string
	Alias       *string
}

func (Item) String

func (i Item) String() string

type Location

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

func (Location) String

func (l Location) String() string

type Tool

type Tool struct {
	Name        string
	Description *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