linear

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package linear is the Linear issue tracker: webhooks signed with HMAC (Linear-Signature), and the GraphQL API reached with the personal API key of the Linear user kōjō acts as.

Linear's documentation: https://linear.app/developers/webhooks and https://linear.app/developers/graphql.

Index

Constants

View Source
const DefaultAPIURL = "https://api.linear.app/graphql"

DefaultAPIURL is Linear's GraphQL endpoint.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Tracker)

Option changes how New builds the tracker.

func WithClock

func WithClock(now func() time.Time) Option

WithClock sets the clock webhook timestamps are checked against.

func WithHTTPClient

func WithHTTPClient(c *http.Client) Option

WithHTTPClient sets the HTTP client of API calls.

func WithLogger

func WithLogger(l *slog.Logger) Option

WithLogger sets the logger.

type Tracker

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

Tracker is a Linear workspace.

func New

func New(cfg config.Linear, opts ...Option) (*Tracker, error)

New returns the Linear tracker of a kojo.yaml section.

func (*Tracker) Check

func (t *Tracker) Check(ctx context.Context) error

Check implements tracker.Tracker: the API key reads its user.

func (*Tracker) Comment

func (t *Tracker) Comment(ctx context.Context, id, text string) (string, error)

Comment implements tracker.Tracker. Linear comments are Markdown, so the text is posted as it is.

func (*Tracker) GetTicket

func (t *Tracker) GetTicket(ctx context.Context, id string) (*tracker.Ticket, error)

GetTicket implements tracker.Tracker. id is the issue's UUID or its identifier (ENG-123): Linear's issue query takes either.

func (*Tracker) Move

func (t *Tracker) Move(ctx context.Context, id string, stage tracker.Stage) error

Move implements tracker.Tracker: the issue moves to the workflow state of its team that has the configured name.

func (*Tracker) Name

func (t *Tracker) Name() string

Name implements tracker.Tracker.

func (*Tracker) ParseWebhook

func (t *Tracker) ParseWebhook(r *http.Request, body []byte) (*tracker.Delivery, error)

ParseWebhook implements tracker.Tracker. It verifies Linear-Signature (the hex HMAC-SHA256 of the raw body under the webhook's signing secret) and that the delivery is fresh, and turns an issue assigned to kōjō's user, a configured label added to an issue, or a comment that mentions kōjō into an event.

Jump to

Keyboard shortcuts

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