Documentation
¶
Index ¶
- Constants
- Variables
- func GetRetryAfter(err error) time.Duration
- func IsAuthError(err error) bool
- func IsNotFound(err error) bool
- func IsRateLimited(err error) bool
- func SetTestAuthToken(token string)
- func SetTestTransport(t http.RoundTripper)
- func WithRetry(fn func() error, maxRetries int) error
- func WithRetryDelays(fn func() error, maxRetries int, delays []time.Duration) error
- func WrapError(operation, resource string, err error) error
- type APIError
- type Actor
- type AddCommentInput
- type AddProjectV2ItemByIdInput
- type AddSubIssueInput
- type BatchUpdateResult
- type BoardItem
- type BoardItemsFilter
- type Client
- func (c *Client) AddIssueComment(issueID, body string) (*Comment, error)
- func (c *Client) AddIssueToProject(projectID, issueID string) (string, error)
- func (c *Client) AddLabelToIssue(owner, repo, issueID, labelName string) error
- func (c *Client) AddSubIssue(parentIssueID, childIssueID string) error
- func (c *Client) BatchUpdateProjectItemFields(projectID string, updates []FieldUpdate, fields []ProjectField) ([]BatchUpdateResult, error)
- func (c *Client) CloseIssue(issueID string) error
- func (c *Client) CopyProjectFromTemplate(ownerID, sourceProjectID, title string) (*Project, error)
- func (c *Client) CreateIssue(owner, repo, title, body string, labels []string) (*Issue, error)
- func (c *Client) CreateIssueWithOptions(owner, repo, title, body string, labels, assignees []string, milestone string) (*Issue, error)
- func (c *Client) CreateLabel(owner, repo, name, color, description string) error
- func (c *Client) CreateProjectField(projectID, name, dataType string, singleSelectOptions []string) (*ProjectField, error)
- func (c *Client) DeleteLabel(owner, repo, labelName string) error
- func (c *Client) DeleteProjectField(fieldID string) error
- func (c *Client) EnsureLabelExists(owner, repo, labelName string) (string, error)
- func (c *Client) FieldExists(projectID, fieldName string) (bool, error)
- func (c *Client) GetAuthenticatedUser() (string, error)
- func (c *Client) GetClosedIssuesByLabel(owner, repo, label string) ([]Issue, error)
- func (c *Client) GetIssue(owner, repo string, number int) (*Issue, error)
- func (c *Client) GetIssueByNumber(owner, repo string, number int) (*Issue, error)
- func (c *Client) GetIssueComments(owner, repo string, number int) ([]Comment, error)
- func (c *Client) GetIssueWithProjectFields(owner, repo string, number int) (*Issue, []FieldValue, error)
- func (c *Client) GetIssuesWithProjectFieldsBatch(owner, repo string, numbers []int) (map[int]*Issue, map[int][]FieldValue, map[int]error, error)
- func (c *Client) GetLatestGitTag() (string, error)
- func (c *Client) GetOpenIssuesByLabel(owner, repo, label string) ([]Issue, error)
- func (c *Client) GetOwnerID(owner string) (string, error)
- func (c *Client) GetParentIssue(owner, repo string, number int) (*Issue, error)
- func (c *Client) GetParentIssueBatch(owner, repo string, numbers []int) (map[int]*Issue, error)
- func (c *Client) GetProject(owner string, number int) (*Project, error)
- func (c *Client) GetProjectFields(projectID string) ([]ProjectField, error)
- func (c *Client) GetProjectFieldsForIssues(projectID string, issueIDs []string) (map[string][]FieldValue, error)
- func (c *Client) GetProjectItemFieldValue(projectID, itemID, fieldName string) (string, error)
- func (c *Client) GetProjectItemID(projectID, issueID string) (string, error)
- func (c *Client) GetProjectItemIDForIssue(projectID, owner, repo string, number int) (string, error)
- func (c *Client) GetProjectItems(projectID string, filter *ProjectItemsFilter) ([]ProjectItem, error)
- func (c *Client) GetProjectItemsByIssues(projectID string, refs []IssueRef) ([]ProjectItem, error)
- func (c *Client) GetProjectItemsForBoard(projectID string, filter *BoardItemsFilter) ([]BoardItem, error)
- func (c *Client) GetProjectItemsMinimal(projectID string, filter *ProjectItemsFilter) ([]MinimalProjectItem, error)
- func (c *Client) GetRepositoryID(owner, repo string) (string, error)
- func (c *Client) GetRepositoryIssues(owner, repo, state string) ([]Issue, error)
- func (c *Client) GetSubIssueCounts(owner, repo string, numbers []int) (map[int]int, error)
- func (c *Client) GetSubIssues(owner, repo string, number int) ([]SubIssue, error)
- func (c *Client) GetSubIssuesBatch(owner, repo string, numbers []int) (map[int][]SubIssue, error)
- func (c *Client) GitAdd(paths ...string) error
- func (c *Client) GitCheckoutNewBranch(branch string) error
- func (c *Client) GitCommit(message string) error
- func (c *Client) GitTag(tag, message string) error
- func (c *Client) LabelExists(owner, repo, labelName string) (bool, error)
- func (c *Client) LinkProjectToRepository(projectID, repositoryID string) error
- func (c *Client) ListProjects(owner string) ([]Project, error)
- func (c *Client) MkdirAll(path string) error
- func (c *Client) RemoveLabelFromIssue(owner, repo, issueID, labelName string) error
- func (c *Client) RemoveSubIssue(parentIssueID, childIssueID string) error
- func (c *Client) ReopenIssue(issueID string) error
- func (c *Client) SearchRepositoryIssues(owner, repo string, filters SearchFilters, limit int) ([]Issue, error)
- func (c *Client) SetProjectItemField(projectID, itemID, fieldName, value string) error
- func (c *Client) SetProjectItemFieldWithFields(projectID, itemID, fieldName, value string, fields []ProjectField) error
- func (c *Client) UpdateIssueBody(issueID, body string) error
- func (c *Client) UpdateIssueTitle(issueID, title string) error
- func (c *Client) UpdateLabel(owner, repo, labelName, newName, newColor, newDescription string) error
- func (c *Client) WriteFile(path, content string) error
- type ClientOptions
- type CloseIssueInput
- type Comment
- type CopyProjectV2Input
- type CreateIssueInput
- type CreateLabelInput
- type CreateProjectV2FieldInput
- type DeleteLabelInput
- type DeleteProjectV2FieldInput
- type FieldOption
- type FieldUpdate
- type FieldValue
- type GraphQLClient
- type Issue
- type IssueRef
- type IssueState
- type Label
- type Milestone
- type MinimalProjectItem
- type Project
- type ProjectField
- type ProjectItem
- type ProjectItemsFilter
- type ProjectOwner
- type ProjectV2FieldValue
- type ProjectV2SingleSelectFieldOptionInput
- type RemoveSubIssueInput
- type ReopenIssueInput
- type Repository
- type SearchFilters
- type SubIssue
- type UpdateIssueInput
- type UpdateLabelInput
- type UpdateProjectV2ItemFieldValueInput
Constants ¶
const FeatureIssueTypes = "issue_types"
FeatureIssueTypes is the GitHub API preview header for issue types
const FeatureSubIssues = "sub_issues"
FeatureSubIssues is the GitHub API preview header for sub-issues
Variables ¶
var ( ErrNotAuthenticated = errors.New("not authenticated - run 'gh auth login' first") ErrNotFound = errors.New("resource not found") ErrRateLimited = errors.New("API rate limit exceeded") )
Common errors
var DefaultRetryDelays = []time.Duration{ 1 * time.Second, 2 * time.Second, 4 * time.Second, 8 * time.Second, }
DefaultRetryDelays defines the exponential backoff delays for retry attempts
Functions ¶
func GetRetryAfter ¶ added in v1.0.2
GetRetryAfter extracts a Retry-After duration from an error, if available. Returns 0 if no Retry-After information is present.
func IsAuthError ¶
IsAuthError checks if an error indicates authentication issues
func IsNotFound ¶
IsNotFound checks if an error indicates a resource was not found
func IsRateLimited ¶
IsRateLimited checks if an error indicates rate limiting. Detects rate limits via:
- Sentinel ErrRateLimited
- HTTP 429 status code (any 429 is a rate limit)
- HTTP 403 with rate-limit messaging (GitHub secondary rate limits)
- Error message containing "rate limit" or "RATE_LIMITED"
Non-rate-limit 403 errors (e.g., permission denied) are NOT retried.
func SetTestAuthToken ¶ added in v0.8.5
func SetTestAuthToken(token string)
SetTestAuthToken sets a custom auth token for testing purposes. Call with empty string to clear the test token.
func SetTestTransport ¶ added in v0.8.5
func SetTestTransport(t http.RoundTripper)
SetTestTransport sets a custom transport for testing purposes. Call with nil to clear the test transport.
func WithRetry ¶ added in v0.11.1
WithRetry executes a function with automatic retry on rate limit errors. Uses exponential backoff: 1s, 2s, 4s, 8s delays. Returns the function's error if not rate limited, or after max retries exceeded.
func WithRetryDelays ¶ added in v0.11.1
WithRetryDelays executes a function with automatic retry using custom delays. This variant is primarily for testing to allow faster tests. If the error carries a Retry-After header, that value overrides the default delay.
Types ¶
type AddCommentInput ¶ added in v0.10.1
type AddCommentInput struct {
SubjectID graphql.ID `json:"subjectId"`
Body graphql.String `json:"body"`
}
AddCommentInput represents the input for adding a comment
type AddProjectV2ItemByIdInput ¶
type AddProjectV2ItemByIdInput struct {
ProjectID graphql.ID `json:"projectId"`
ContentID graphql.ID `json:"contentId"`
}
AddProjectV2ItemByIdInput represents the input for adding an item to a project
type AddSubIssueInput ¶
type AddSubIssueInput struct {
IssueID graphql.ID `json:"issueId"`
SubIssueID graphql.ID `json:"subIssueId"`
}
AddSubIssueInput represents the input for adding a sub-issue
type BatchUpdateResult ¶ added in v0.12.0
BatchUpdateResult represents the result of a single update in a batch
type BoardItem ¶ added in v0.12.0
type BoardItem struct {
Number int
Title string
State string // Issue state: "OPEN" or "CLOSED"
Status string
Priority string
Repository string // "owner/repo" format for filtering
}
BoardItem represents a minimal project item for board display. Contains only the fields needed for the board view to minimize API data transfer.
type BoardItemsFilter ¶ added in v0.12.0
type BoardItemsFilter struct {
Repository string // Filter by repository (owner/repo format)
State *string // Filter by issue state: "OPEN", "CLOSED", or nil for all
}
BoardItemsFilter allows filtering board items
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the GitHub GraphQL API client with project management features
func NewClientWithGraphQL ¶
func NewClientWithGraphQL(gql GraphQLClient) *Client
NewClientWithGraphQL creates a Client with a custom GraphQL client (for testing)
func NewClientWithOptions ¶
func NewClientWithOptions(opts ClientOptions) *Client
NewClientWithOptions creates a new API client with custom options
func (*Client) AddIssueComment ¶ added in v0.10.1
AddIssueComment adds a comment to an issue
func (*Client) AddIssueToProject ¶
AddIssueToProject adds an issue to a GitHub Project V2
func (*Client) AddLabelToIssue ¶
AddLabelToIssue adds a label to an issue. If the label doesn't exist in the repository, it will be created automatically.
func (*Client) AddSubIssue ¶
AddSubIssue links a child issue as a sub-issue of a parent issue
func (*Client) BatchUpdateProjectItemFields ¶ added in v0.12.0
func (c *Client) BatchUpdateProjectItemFields(projectID string, updates []FieldUpdate, fields []ProjectField) ([]BatchUpdateResult, error)
BatchUpdateProjectItemFields executes multiple field updates in a single GraphQL mutation. This reduces API calls from O(N) to O(N/batchSize) where batchSize is 50. Returns results for each update indicating success or failure.
func (*Client) CloseIssue ¶ added in v0.6.0
CloseIssue closes an issue by its ID
func (*Client) CopyProjectFromTemplate ¶ added in v0.14.0
CopyProjectFromTemplate creates a new project by copying from a template project. ownerID is the node ID of the owner (user or organization) sourceProjectID is the node ID of the template project to copy from title is the title for the new project
func (*Client) CreateIssue ¶
CreateIssue creates a new issue in a repository
func (*Client) CreateIssueWithOptions ¶
func (c *Client) CreateIssueWithOptions(owner, repo, title, body string, labels, assignees []string, milestone string) (*Issue, error)
CreateIssueWithOptions creates an issue with extended options
func (*Client) CreateLabel ¶ added in v0.7.0
CreateLabel creates a new label in a repository
func (*Client) CreateProjectField ¶ added in v0.5.0
func (c *Client) CreateProjectField(projectID, name, dataType string, singleSelectOptions []string) (*ProjectField, error)
CreateProjectField creates a new field in a GitHub project. Supported field types: TEXT, NUMBER, DATE, SINGLE_SELECT, ITERATION
func (*Client) DeleteLabel ¶ added in v0.11.0
DeleteLabel deletes a label from a repository
func (*Client) DeleteProjectField ¶ added in v0.14.0
DeleteProjectField deletes a field from a GitHub project. Note: Built-in fields (Title, Assignees, etc.) cannot be deleted.
func (*Client) EnsureLabelExists ¶ added in v0.12.0
EnsureLabelExists checks if a label exists and creates it if not. Returns the label ID. Only creates labels that are defined in the standard defaults. Returns an error for non-standard labels.
func (*Client) FieldExists ¶ added in v0.7.0
FieldExists checks if a field exists in a project by name
func (*Client) GetAuthenticatedUser ¶ added in v0.6.0
GetAuthenticatedUser returns the login of the currently authenticated user
func (*Client) GetClosedIssuesByLabel ¶ added in v0.6.0
GetClosedIssuesByLabel fetches closed issues with a specific label
func (*Client) GetIssueByNumber ¶ added in v0.6.0
GetIssueByNumber returns an issue by its number (alias for GetIssue)
func (*Client) GetIssueComments ¶
GetIssueComments fetches comments for an issue
func (*Client) GetIssueWithProjectFields ¶ added in v0.8.2
func (c *Client) GetIssueWithProjectFields(owner, repo string, number int) (*Issue, []FieldValue, error)
GetIssueWithProjectFields fetches an issue and its project field values in a single query. This is more efficient than calling GetIssue + GetProjectItems when you only need one issue.
func (*Client) GetIssuesWithProjectFieldsBatch ¶ added in v1.1.0
func (c *Client) GetIssuesWithProjectFieldsBatch(owner, repo string, numbers []int) (map[int]*Issue, map[int][]FieldValue, map[int]error, error)
GetIssuesWithProjectFieldsBatch fetches multiple issues with full detail (including author, milestone, labels, assignees) and project field values in a single GraphQL query. Optimized for the view command's batch mode.
func (*Client) GetLatestGitTag ¶ added in v0.7.0
GetLatestGitTag returns the latest git tag using git describe
func (*Client) GetOpenIssuesByLabel ¶ added in v0.6.0
GetOpenIssuesByLabel fetches open issues with a specific label
func (*Client) GetOwnerID ¶ added in v0.14.0
GetOwnerID returns the node ID for a user or organization.
func (*Client) GetParentIssue ¶
GetParentIssue fetches the parent issue for a given sub-issue
func (*Client) GetParentIssueBatch ¶ added in v1.1.0
GetParentIssueBatch fetches parent issues for multiple issues in a single query. Returns a map from child issue number to parent *Issue (nil if no parent).
func (*Client) GetProject ¶
GetProject fetches a project by owner and number
func (*Client) GetProjectFields ¶
func (c *Client) GetProjectFields(projectID string) ([]ProjectField, error)
GetProjectFields fetches all fields for a project. Uses cursor-based pagination to retrieve all fields regardless of project size.
func (*Client) GetProjectFieldsForIssues ¶ added in v0.12.0
func (c *Client) GetProjectFieldsForIssues(projectID string, issueIDs []string) (map[string][]FieldValue, error)
GetProjectFieldsForIssues fetches project field values for multiple issues in batched queries. Returns a map from issue node ID to its field values. Uses batching to avoid query size limits.
func (*Client) GetProjectItemFieldValue ¶ added in v0.6.0
GetProjectItemFieldValue returns the value of a field on a project item
func (*Client) GetProjectItemID ¶ added in v0.6.0
GetProjectItemID returns the project item ID for an issue in a project
func (*Client) GetProjectItemIDForIssue ¶ added in v0.8.3
func (c *Client) GetProjectItemIDForIssue(projectID, owner, repo string, number int) (string, error)
GetProjectItemIDForIssue looks up the project item ID for a specific issue in a project. This is more efficient than fetching all project items when you only need one.
func (*Client) GetProjectItems ¶
func (c *Client) GetProjectItems(projectID string, filter *ProjectItemsFilter) ([]ProjectItem, error)
GetProjectItems fetches all items from a project with their field values. Uses cursor-based pagination to retrieve all items regardless of project size. If filter.Limit > 0, pagination terminates early once the limit is reached.
func (*Client) GetProjectItemsByIssues ¶ added in v0.12.0
func (c *Client) GetProjectItemsByIssues(projectID string, refs []IssueRef) ([]ProjectItem, error)
GetProjectItemsByIssues fetches project items for specific issues using a targeted query. This is more efficient than GetProjectItems when you know which issues you need, as it only fetches the specified issues rather than the entire project. Returns items only for issues that exist in the specified project.
func (*Client) GetProjectItemsForBoard ¶ added in v0.12.0
func (c *Client) GetProjectItemsForBoard(projectID string, filter *BoardItemsFilter) ([]BoardItem, error)
GetProjectItemsForBoard fetches minimal project item data optimized for board display. Only retrieves: Number, Title, Status, Priority, and Repository. Uses cursor-based pagination to retrieve all items regardless of project size.
func (*Client) GetProjectItemsMinimal ¶ added in v0.13.5
func (c *Client) GetProjectItemsMinimal(projectID string, filter *ProjectItemsFilter) ([]MinimalProjectItem, error)
GetProjectItemsMinimal fetches project items with minimal issue data. This is optimized for filtering by field values (like Branch) without fetching full issue details (Body, Title, Assignees, Labels) which can be large. Use this for two-phase queries: first filter with minimal data, then fetch full details for matching items only.
func (*Client) GetRepositoryID ¶ added in v0.14.0
GetRepositoryID returns the node ID for a repository.
func (*Client) GetRepositoryIssues ¶
GetRepositoryIssues fetches issues from a repository with the given state filter
func (*Client) GetSubIssueCounts ¶ added in v0.8.3
GetSubIssueCounts fetches sub-issue counts for multiple issues in a single query. This is more efficient than calling GetSubIssues for each issue individually. Returns a map of issue number to sub-issue count.
func (*Client) GetSubIssues ¶
GetSubIssues fetches all sub-issues for a given issue with pagination support
func (*Client) GetSubIssuesBatch ¶ added in v0.12.0
GetSubIssuesBatch fetches sub-issues for multiple parent issues in a single query. All parent issues must be from the same repository. Returns a map of parent issue number to their sub-issues. This is more efficient than calling GetSubIssues for each parent individually, reducing API calls from O(N) to O(1) per batch.
func (*Client) GitCheckoutNewBranch ¶ added in v0.7.5
GitCheckoutNewBranch creates and checks out a new git branch
func (*Client) LabelExists ¶ added in v0.7.0
LabelExists checks if a label exists in a repository
func (*Client) LinkProjectToRepository ¶ added in v0.14.0
LinkProjectToRepository adds a repository to a project's linked repositories.
func (*Client) ListProjects ¶
ListProjects fetches all projects for an owner (user or organization)
func (*Client) RemoveLabelFromIssue ¶ added in v0.11.1
RemoveLabelFromIssue removes a label from an issue
func (*Client) RemoveSubIssue ¶
RemoveSubIssue removes a child issue from its parent issue
func (*Client) ReopenIssue ¶ added in v0.8.0
ReopenIssue reopens a closed issue
func (*Client) SearchRepositoryIssues ¶ added in v0.12.0
func (c *Client) SearchRepositoryIssues(owner, repo string, filters SearchFilters, limit int) ([]Issue, error)
SearchRepositoryIssues searches for issues in a repository using GitHub Search API. This is more efficient than fetching all issues when filtering by state, labels, or text. The limit parameter controls maximum results (0 = no limit, uses pagination).
func (*Client) SetProjectItemField ¶
SetProjectItemField sets a field value on a project item. This method fetches project fields on each call. For bulk operations, use SetProjectItemFieldWithFields with pre-fetched fields for better performance.
func (*Client) SetProjectItemFieldWithFields ¶ added in v0.9.2
func (c *Client) SetProjectItemFieldWithFields(projectID, itemID, fieldName, value string, fields []ProjectField) error
SetProjectItemFieldWithFields sets a field value using pre-fetched project fields. Use this method for bulk operations to avoid redundant GetProjectFields API calls.
func (*Client) UpdateIssueBody ¶ added in v0.6.0
UpdateIssueBody updates the body of an issue
func (*Client) UpdateIssueTitle ¶ added in v0.9.7
UpdateIssueTitle updates the title of an issue
func (*Client) UpdateLabel ¶ added in v0.11.0
func (c *Client) UpdateLabel(owner, repo, labelName, newName, newColor, newDescription string) error
UpdateLabel updates a label's properties in a repository
type ClientOptions ¶
type ClientOptions struct {
// Host is the GitHub hostname (default: github.com)
Host string
// EnableSubIssues enables the sub_issues feature preview
EnableSubIssues bool
// EnableIssueTypes enables the issue_types feature preview
EnableIssueTypes bool
// Transport specifies the HTTP transport for API requests (for testing)
Transport http.RoundTripper
// AuthToken is the authorization token (for testing)
AuthToken string
}
ClientOptions configures the API client
type CloseIssueInput ¶ added in v0.8.6
CloseIssueInput represents the input for closing an issue
type CopyProjectV2Input ¶ added in v1.0.3
type CopyProjectV2Input struct {
OwnerId graphql.ID `json:"ownerId"`
ProjectId graphql.ID `json:"projectId"`
Title graphql.String `json:"title"`
IncludeDraftIssues graphql.Boolean `json:"includeDraftIssues"`
}
CopyProjectV2Input represents the input for copying a project.
type CreateIssueInput ¶
type CreateIssueInput struct {
RepositoryID graphql.ID `json:"repositoryId"`
Title graphql.String `json:"title"`
Body graphql.String `json:"body,omitempty"`
LabelIDs *[]graphql.ID `json:"labelIds,omitempty"`
AssigneeIDs *[]graphql.ID `json:"assigneeIds,omitempty"`
MilestoneID *graphql.ID `json:"milestoneId,omitempty"`
}
CreateIssueInput represents the input for creating an issue
type CreateLabelInput ¶ added in v0.7.0
type CreateLabelInput struct {
RepositoryID graphql.ID `json:"repositoryId"`
Name graphql.String `json:"name"`
Color graphql.String `json:"color"`
Description graphql.String `json:"description,omitempty"`
}
CreateLabelInput represents the input for creating a label
type CreateProjectV2FieldInput ¶ added in v0.5.0
type CreateProjectV2FieldInput struct {
ProjectID graphql.ID `json:"projectId"`
DataType graphql.String `json:"dataType"`
Name graphql.String `json:"name"`
SingleSelectOptions *[]ProjectV2SingleSelectFieldOptionInput `json:"singleSelectOptions,omitempty"`
}
CreateProjectV2FieldInput represents the input for creating a project field
type DeleteLabelInput ¶ added in v0.11.0
DeleteLabelInput represents the input for deleting a label
type DeleteProjectV2FieldInput ¶ added in v0.14.1
DeleteProjectV2FieldInput represents the input for deleting a project field
type FieldOption ¶
FieldOption represents an option for a single-select field
type FieldUpdate ¶ added in v0.12.0
type FieldUpdate struct {
ItemID string // Project item ID
FieldName string // Field name (e.g., "Status", "Priority")
Value string // Display value (e.g., "In Progress", "P1")
// contains filtered or unexported fields
}
FieldUpdate represents a single field update for batch operations
type FieldValue ¶
FieldValue represents a field value on a project item
type GraphQLClient ¶
type GraphQLClient interface {
Query(name string, query interface{}, variables map[string]interface{}) error
Mutate(name string, mutation interface{}, variables map[string]interface{}) error
}
GraphQLClient interface allows mocking the GitHub GraphQL client for testing
type Issue ¶
type Issue struct {
ID string
Number int
Title string
Body string
State string
URL string
Repository Repository
Author Actor
Assignees []Actor
Labels []Label
Milestone *Milestone
}
Issue represents a GitHub issue
type IssueRef ¶ added in v0.12.0
IssueRef represents a reference to a GitHub issue by owner/repo/number. Used for targeted queries that fetch specific issues instead of all project items.
type IssueState ¶ added in v0.8.5
type IssueState string
IssueState represents GitHub issue state enum for GraphQL queries
const ( IssueStateOpen IssueState = "OPEN" IssueStateClosed IssueState = "CLOSED" )
type MinimalProjectItem ¶ added in v0.13.5
type MinimalProjectItem struct {
IssueID string // GitHub node ID for API operations
IssueNumber int // Issue number for display and IssueRef
IssueState string // "OPEN" or "CLOSED" for filtering
Repository string // "owner/repo" format
FieldValues []FieldValue // Project field values for filtering
}
MinimalProjectItem represents a project item with minimal issue data. Used for two-phase queries: first fetch minimal data for filtering, then fetch full details only for matching items. This avoids fetching Title, Body, Assignees, Labels for non-matching items.
type ProjectField ¶
type ProjectField struct {
ID string
Name string
DataType string
Options []FieldOption // For SINGLE_SELECT fields
}
ProjectField represents a field in a GitHub project
type ProjectItem ¶
type ProjectItem struct {
ID string
Issue *Issue
FieldValues []FieldValue
}
ProjectItem represents an issue or PR within a project
type ProjectItemsFilter ¶
type ProjectItemsFilter struct {
Repository string // Filter by repository (owner/repo format)
State *string // Filter by issue state: "OPEN", "CLOSED", or nil for all
Limit int // Maximum number of items to return (0 = no limit)
}
ProjectItemsFilter allows filtering project items
type ProjectOwner ¶
ProjectOwner represents the owner of a project
type ProjectV2FieldValue ¶
type ProjectV2FieldValue struct {
Text graphql.String `json:"text,omitempty"`
Number graphql.Float `json:"number,omitempty"`
Date graphql.String `json:"date,omitempty"`
SingleSelectOptionId graphql.String `json:"singleSelectOptionId,omitempty"`
IterationId graphql.String `json:"iterationId,omitempty"`
}
ProjectV2FieldValue represents a field value for a project item
type ProjectV2SingleSelectFieldOptionInput ¶ added in v0.5.0
type ProjectV2SingleSelectFieldOptionInput struct {
Name graphql.String `json:"name"`
Color graphql.String `json:"color,omitempty"`
Description graphql.String `json:"description,omitempty"`
}
ProjectV2SingleSelectFieldOptionInput represents an option for a single select field
type RemoveSubIssueInput ¶
type RemoveSubIssueInput struct {
IssueID graphql.ID `json:"issueId"`
SubIssueID graphql.ID `json:"subIssueId"`
}
RemoveSubIssueInput represents the input for removing a sub-issue
type ReopenIssueInput ¶ added in v0.8.6
ReopenIssueInput represents the input for reopening an issue
type Repository ¶
Repository represents a GitHub repository
type SearchFilters ¶ added in v0.12.0
type SearchFilters struct {
State string // "open", "closed", or "all"
Labels []string // Filter by label names
Assignee string // Filter by assignee login
Search string // Free-text search in title/body
}
SearchFilters contains filters for searching repository issues
type SubIssue ¶
type SubIssue struct {
ID string
Number int
Title string
State string
URL string
ParentID string
Repository Repository // Repository where the sub-issue lives
}
SubIssue represents a sub-issue relationship
type UpdateIssueInput ¶ added in v0.8.6
type UpdateIssueInput struct {
ID graphql.ID `json:"id"`
Body graphql.String `json:"body,omitempty"`
Title graphql.String `json:"title,omitempty"`
}
UpdateIssueInput represents the input for updating an issue
type UpdateLabelInput ¶ added in v0.11.0
type UpdateLabelInput struct {
ID graphql.ID `json:"id"`
Name graphql.String `json:"name,omitempty"`
Color graphql.String `json:"color,omitempty"`
Description graphql.String `json:"description,omitempty"`
}
UpdateLabelInput represents the input for updating a label
type UpdateProjectV2ItemFieldValueInput ¶
type UpdateProjectV2ItemFieldValueInput struct {
ProjectID graphql.ID `json:"projectId"`
ItemID graphql.ID `json:"itemId"`
FieldID graphql.ID `json:"fieldId"`
Value ProjectV2FieldValue `json:"value"`
}
UpdateProjectV2ItemFieldValueInput represents the input for updating a field value