linear

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadInstances

func LoadInstances(dir string) ([]tracker.Instance, error)

LoadInstances reads config, applies env overrides, creates clients, and returns ready-to-use tracker instances.

Types

type Client

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

Client is a Linear GraphQL API client that implements tracker.Provider.

func New

func New(baseURL, token string) *Client

New creates a Linear client with the given base URL and API key.

func (*Client) AddComment

func (c *Client) AddComment(ctx context.Context, issueKey string, body string) (*tracker.Comment, error)

AddComment implements tracker.Commenter.

func (*Client) AssignIssue

func (c *Client) AssignIssue(ctx context.Context, key string, userID string) error

AssignIssue implements tracker.Assigner.

func (*Client) CreateIssue

func (c *Client) CreateIssue(ctx context.Context, issue *tracker.Issue) (*tracker.Issue, error)

CreateIssue implements tracker.Creator.

func (*Client) DeleteIssue

func (c *Client) DeleteIssue(ctx context.Context, key string) error

DeleteIssue implements tracker.Deleter.

func (*Client) EditIssue

func (c *Client) EditIssue(ctx context.Context, key string, opts tracker.EditOptions) (*tracker.Issue, error)

EditIssue implements tracker.Editor.

func (*Client) GetCurrentUser

func (c *Client) GetCurrentUser(ctx context.Context) (string, error)

GetCurrentUser implements tracker.CurrentUserGetter.

func (*Client) GetIssue

func (c *Client) GetIssue(ctx context.Context, key string) (*tracker.Issue, error)

GetIssue implements tracker.Getter.

func (*Client) ListComments

func (c *Client) ListComments(ctx context.Context, issueKey string) ([]tracker.Comment, error)

ListComments implements tracker.Commenter.

func (*Client) ListIssues

func (c *Client) ListIssues(ctx context.Context, opts tracker.ListOptions) ([]tracker.Issue, error)

ListIssues implements tracker.Lister.

func (*Client) ListStatuses

func (c *Client) ListStatuses(ctx context.Context, key string) ([]tracker.Status, error)

ListStatuses implements tracker.StatusLister.

func (*Client) SetHTTPDoer

func (c *Client) SetHTTPDoer(doer apiclient.HTTPDoer)

SetHTTPDoer replaces the HTTP client used for API requests.

func (*Client) TransitionIssue

func (c *Client) TransitionIssue(ctx context.Context, key string, targetStatus string) error

TransitionIssue implements tracker.Transitioner.

type Config

type Config struct {
	Name        string   `mapstructure:"name"`
	URL         string   `mapstructure:"url"`
	Token       string   `mapstructure:"token"`
	Description string   `mapstructure:"description"`
	Safe        bool     `mapstructure:"safe"`
	Projects    []string `mapstructure:"projects"`
}

Config holds the configuration for a single Linear instance.

func LoadConfigs

func LoadConfigs(dir string) ([]Config, error)

LoadConfigs reads a .humanconfig YAML file from dir and returns the list of configured Linear instances. Returns nil and no error if the file does not exist.

Jump to

Keyboard shortcuts

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