deckard

package module
v0.0.0-...-7f4b492 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: GPL-3.0 Imports: 16 Imported by: 0

README

deckard

looking for replicants

Deckard

Documentation

Index

Constants

View Source
const (
	STATE_NEW      = "new"
	STATE_REVIEWED = "rev"
)
View Source
const SelectionMarker = "sel"

Variables

This section is empty.

Functions

func GetFetchState

func GetFetchState(db *sql.DB, project string) (*time.Time, error)

func InitDB

func InitDB(config *Config) (*sql.DB, error)

func StoreCommits

func StoreCommits(db *sql.DB, commits []*Commit) error

func UpdateCommitState

func UpdateCommitState(db *sql.DB, project, hash string, state CommitState) error

func UpdateFetchState

func UpdateFetchState(db *sql.DB, project string, t *time.Time) error

func UpdateFromDB

func UpdateFromDB(db *sql.DB, ui *DeckardUI) error

func UpdateFromRepo

func UpdateFromRepo(ui *DeckardUI)

RepoUpdate refreshes all repo based resources after the UI has been started.

Types

type Commit

type Commit struct {
	Project       string
	Hash          string
	Subject       string
	Message       string
	AuthorName    string
	CommitterName string
	CommitWhen    time.Time
	State         string
	Comment       *string
	SlatScore     int // score between 0 and 100
}

type CommitState

type CommitState string

type Config

type Config struct {
	CodeFolder string                   `toml:"code_folder"`
	Projects   map[string]ConfigProject `toml:"project"`
}

func LoadConfig

func LoadConfig() (*Config, error)

TODO Create config with project data and render them on the screen in the top bar

type ConfigProject

type ConfigProject struct {
	Icon string `toml:"icon"`
	Repo string `toml:"repo"`
}

type DeckardUI

type DeckardUI struct {
	// contains filtered or unexported fields
}

func BuildUI

func BuildUI(config *Config, db *sql.DB) (*DeckardUI, error)

func (*DeckardUI) AddCommits

func (ui *DeckardUI) AddCommits(commits []*Commit)

func (*DeckardUI) ClearStatus

func (ui *DeckardUI) ClearStatus()

func (*DeckardUI) MarkAsReviewed

func (ui *DeckardUI) MarkAsReviewed(commit *Commit)

func (*DeckardUI) Quit

func (ui *DeckardUI) Quit()

func (*DeckardUI) Run

func (ui *DeckardUI) Run() error

func (*DeckardUI) SelectProject

func (ui *DeckardUI) SelectProject(id int)

func (*DeckardUI) UpdateStatus

func (ui *DeckardUI) UpdateStatus(text string)

TODO Render spinner (optional parameter)

type Diff

type Diff struct {
	Stats []NumStat
}

type NumStat

type NumStat struct {
	Added   uint64
	Deleted uint64
	File    string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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