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
- type Option
- type Tracker
- func (t *Tracker) Check(ctx context.Context) error
- func (t *Tracker) Comment(ctx context.Context, id, text string) (string, error)
- func (t *Tracker) GetTicket(ctx context.Context, id string) (*tracker.Ticket, error)
- func (t *Tracker) Move(ctx context.Context, id string, stage tracker.Stage) error
- func (t *Tracker) Name() string
- func (t *Tracker) ParseWebhook(r *http.Request, body []byte) (*tracker.Delivery, error)
Constants ¶
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 WithHTTPClient ¶
WithHTTPClient sets the HTTP client of API calls.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker is a Linear workspace.
func (*Tracker) Comment ¶
Comment implements tracker.Tracker. Linear comments are Markdown, so the text is posted as it is.
func (*Tracker) GetTicket ¶
GetTicket implements tracker.Tracker. id is the issue's UUID or its identifier (ENG-123): Linear's issue query takes either.
func (*Tracker) Move ¶
Move implements tracker.Tracker: the issue moves to the workflow state of its team that has the configured name.
func (*Tracker) ParseWebhook ¶
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.