Documentation
¶
Index ¶
- func FormatIssue(issue *Issue) string
- func LoadToken() (*config.JiraToken, error)
- func SaveToken(token *config.JiraToken) error
- type Client
- func (c *Client) EnsureAuth(ctx context.Context) error
- func (c *Client) GetIssue(ctx context.Context, issueKey string) (*Issue, error)
- func (c *Client) GetMyIssues(ctx context.Context, maxResults int) (*SearchResult, error)
- func (c *Client) GetProjectKeys(ctx context.Context) ([]string, error)
- func (c *Client) GetRecentIssues(ctx context.Context, maxResults int) (*SearchResult, error)
- func (c *Client) GetSiteURL() string
- func (c *Client) ListProjects(ctx context.Context) ([]Project, error)
- func (c *Client) SearchIssues(ctx context.Context, jql string, maxResults int) (*SearchResult, error)
- type Comment
- type Issue
- type JiraSiteInfo
- type OAuthFlow
- func (o *OAuthFlow) ExchangeCode(ctx context.Context, code string) (*config.JiraToken, error)
- func (o *OAuthFlow) GetAuthURL(state string) string
- func (o *OAuthFlow) GetSiteInfo(ctx context.Context, accessToken string) (*JiraSiteInfo, error)
- func (o *OAuthFlow) RefreshToken(ctx context.Context, refreshToken string) (*config.JiraToken, error)
- func (o *OAuthFlow) StartAuthServer(ctx context.Context) (*config.JiraToken, error)
- type Project
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatIssue ¶
FormatIssue returns a formatted string representation of an issue
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) EnsureAuth ¶
EnsureAuth ensures we have a valid token, refreshing or re-authenticating as needed
func (*Client) GetMyIssues ¶
GetMyIssues fetches issues assigned to the current user
func (*Client) GetProjectKeys ¶
GetProjectKeys returns just the project keys (e.g., DEV, TEL)
func (*Client) GetRecentIssues ¶
GetRecentIssues fetches recently updated issues
func (*Client) GetSiteURL ¶
GetSiteURL returns the browsable Jira site URL (e.g., https://company.atlassian.net)
func (*Client) ListProjects ¶
ListProjects fetches all accessible Jira projects
func (*Client) SearchIssues ¶
func (c *Client) SearchIssues(ctx context.Context, jql string, maxResults int) (*SearchResult, error)
SearchIssues searches for issues using JQL
type Issue ¶
type Issue struct {
ID string `json:"id"`
Key string `json:"key"`
Self string `json:"self"`
Fields struct {
Summary string `json:"summary"`
Description any `json:"description"`
Status struct {
Name string `json:"name"`
} `json:"status"`
IssueType struct {
Name string `json:"name"`
} `json:"issuetype"`
Priority struct {
Name string `json:"name"`
} `json:"priority"`
Assignee *struct {
DisplayName string `json:"displayName"`
EmailAddress string `json:"emailAddress"`
} `json:"assignee"`
Reporter *struct {
DisplayName string `json:"displayName"`
EmailAddress string `json:"emailAddress"`
} `json:"reporter"`
Created string `json:"created"`
Updated string `json:"updated"`
Labels []string `json:"labels"`
Parent *Issue `json:"parent"`
Subtasks []Issue `json:"subtasks"`
IssueLinks []struct {
ID string `json:"id"`
Type struct {
Name string `json:"name"`
Inward string `json:"inward"`
Outward string `json:"outward"`
} `json:"type"`
InwardIssue *struct {
Key string `json:"key"`
Fields struct {
Summary string `json:"summary"`
Status struct {
Name string `json:"name"`
} `json:"status"`
} `json:"fields"`
} `json:"inwardIssue"`
OutwardIssue *struct {
Key string `json:"key"`
Fields struct {
Summary string `json:"summary"`
Status struct {
Name string `json:"name"`
} `json:"status"`
} `json:"fields"`
} `json:"outwardIssue"`
} `json:"issuelinks"`
Comment *struct {
Comments []Comment `json:"comments"`
Total int `json:"total"`
} `json:"comment"`
} `json:"fields"`
}
type JiraSiteInfo ¶
JiraSiteInfo contains cloud ID and browsable site URL
type OAuthFlow ¶
type OAuthFlow struct {
// contains filtered or unexported fields
}
func NewOAuthFlow ¶
func (*OAuthFlow) ExchangeCode ¶
ExchangeCode exchanges an authorization code for tokens
func (*OAuthFlow) GetAuthURL ¶
GetAuthURL returns the URL to start the OAuth flow
func (*OAuthFlow) GetSiteInfo ¶
GetSiteInfo fetches the Jira site info (CloudID and SiteURL) from the accessible-resources API