tracker

package
v0.10.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIssueNotFound = errors.New("tracker: issue not found")

ErrIssueNotFound is returned by IsIssueClosed when the tracker has no record of the requested issueID (HTTP 404 or equivalent). Callers can branch on it via errors.Is to distinguish "tracker says open" from "tracker doesn't know".

Functions

func Register

func Register(name string, fn func(config.IssueTrackerConfig) (Tracker, error))

Register adds a factory function for the named tracker type.

Types

type Issue

type Issue struct {
	TrackerType string
	ID          string
	Subject     string
	Description string
	Status      string
	Project     string
}

Issue is the tracker-agnostic representation of a work item.

type Tracker

type Tracker interface {
	// ListIssues retrieves the issues from the tracker
	ListIssues(ctx context.Context) ([]Issue, error)
	// ListStatuses returns the available status names for the tracker.
	ListStatuses(ctx context.Context) ([]string, error)
	// UpdateIssueStatus updates the status from the given issueID
	UpdateIssueStatus(ctx context.Context, issueID, statusName string) error
	// IsIssueClosed reports whether the tracker considers issueID closed.
	// Returns ErrIssueNotFound for missing-issue cases so callers can format
	// the warning distinctly from transport/auth failures.
	IsIssueClosed(ctx context.Context, issueID string) (bool, error)
}

Tracker is the contract every adapter must satisfy.

func New

New constructs a Tracker from cfg using the registered factory.

Directories

Path Synopsis
Package fake provides an in-process tracker.Tracker for tests.
Package fake provides an in-process tracker.Tracker for tests.

Jump to

Keyboard shortcuts

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