Documentation
¶
Overview ¶
Package local is the offline backend: it reads (and later writes) git-native-issue issues stored as commit chains under refs/issues/ in the repository lazydash is launched in. Reads use only git plumbing, so viewing issues never depends on the `git issue` binary being installed.
Index ¶
- func HasIssues(root string) bool
- func RepoRoot(dir string) (string, error)
- type Comment
- type Issue
- type Source
- func (s *Source) Caps() source.Capabilities
- func (s *Source) Comment(item core.Card, body string) error
- func (s *Source) CreateIssue(_ string, d source.Draft) (core.Card, error)
- func (s *Source) GetBoard(string) (*core.BoardData, error)
- func (s *Source) ListProjects() ([]core.Project, error)
- func (s *Source) Name() string
- func (s *Source) SetAssignees(item core.Card, who []string) error
- func (s *Source) SetField(item core.Card, field, option string) error
- func (s *Source) SetLabels(item core.Card, labels []string) error
- func (s *Source) SetState(item core.Card, state string) error
- func (s *Source) Undo(item core.Card) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Issue ¶
type Issue struct {
ID string // UUID: the ref name under refs/issues/
Title string
Body string
State string // "open" | "closed"
Labels []string
Assignee string
Priority string
Milestone string
Comments []Comment
CreatedAt string // ISO-8601 date of the create commit
UpdatedAt string // ISO-8601 date of the tip commit
}
Issue is a single git-native-issue issue, reconstructed by folding its commit chain (create → comments → state changes) into the current state.
func ListIssues ¶
ListIssues reads and reconstructs every issue under refs/issues/ in the repo at root, most-recently-updated first. A malformed ref is skipped rather than failing the whole listing.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is the offline git-native-issue backend for one repository. It presents the repo's issues as a single project with synthesized fields and views, so the board/table renderer treats them exactly like a GitHub project.
func New ¶
New builds a local Source for the repo containing dir. It returns (nil, nil) when dir is not inside a git repo or the repo has no refs/issues/ — an absent local backend is a normal condition (most repos have no local issues), not an error that should be surfaced to the user.
func (*Source) Caps ¶
func (s *Source) Caps() source.Capabilities
Caps reports the backend's capabilities. It works fully offline and supports the whole mutation surface, since writes are authored with git plumbing and need no external binary.
func (*Source) CreateIssue ¶
CreateIssue roots a new issue chain under a fresh refs/issues/<uuid>.
func (*Source) GetBoard ¶
GetBoard reads the repo's issues and folds them into a board with synthesized State/Priority fields and Board/Priority/Table views.
func (*Source) ListProjects ¶
ListProjects exposes the repository as a single synthetic project.
func (*Source) SetAssignees ¶
SetAssignees replaces the assignee.
func (*Source) SetField ¶
SetField sets a single-select field. State maps to close/reopen; every other field is recorded as a trailer of the same (canonicalised) name.
func (*Source) Undo ¶
Undo pops the most recent event off an issue's chain by resetting its ref to the tip's parent. Because the chain is append-only this cleanly reverses the last comment or state/field change; the popped commit stays in the object store (recoverable via reflog). The create commit has no parent and cannot be undone this way.