taskref

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package taskref resolves the ways people name a task: "5187", "#5187", a task branch such as "task/5187-fix-login", or a GitHub PR URL. These are the references the TUI's go-to-task palette recognizes exactly. Anything looser, like words from a title, is a search and belongs to the palette.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PRNumberFromURL

func PRNumberFromURL(s string) int

PRNumberFromURL returns the PR number in a GitHub PR URL, or 0.

func Resolve

func Resolve(store Store, ref string) (*db.Task, error)

Resolve returns the one task ref names, or nil when it names none or more than one: an ID with no task, a PR several tasks share, or search text.

func SearchText

func SearchText(ref string) string

SearchText is what to hand the palette for ref: a PR URL cut down to github.com/org/repo/pull/N, so a pasted ".../pull/N/files" still finds the task, and anything else as typed.

func TaskIDFromBranch

func TaskIDFromBranch(s string) int64

TaskIDFromBranch returns the task ID in a branch name such as "task/1068-description", or 0.

Types

type Store

type Store interface {
	GetTask(id int64) (*db.Task, error)
	SearchTasks(query string, limit int) ([]*db.Task, error)
}

Store is what Resolve reads; *db.DB satisfies it.

Jump to

Keyboard shortcuts

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