Documentation
¶
Index ¶
- type BatchError
- type BatchResult
- type Client
- func (c *Client) AddToProject(issueID, projectID string) (string, error)
- func (c *Client) AddToProjectWithDatabaseID(issueID, projectID string) (string, int, error)
- func (c *Client) CreateIssue(req IssueRequest) (Issue, error)
- func (c *Client) CreateIssueWithData(data *IssueData) (*Issue, error)
- func (c *Client) CreateIssueWithRepo(req IssueRequest, repo string) (Issue, error)
- func (c *Client) GetGraphQLClient() *api.GraphQLClient
- func (c *Client) GetIssue(number int) (Issue, error)
- func (c *Client) GetIssueWithRepo(number int, repo string) (Issue, error)
- func (c *Client) GetProjectItemID(issueID, projectID string) (string, int, error)
- func (c *Client) UpdateIssue(number int, req IssueRequest) error
- func (c *Client) UpdateIssueWithRepo(number int, req IssueRequest, repo string) error
- func (c *Client) UpdateProjectItemField(projectID, itemID, fieldID, optionID string) error
- type Comment
- type Creator
- type ErrorType
- type Issue
- type IssueData
- type IssueError
- func NewAPIError(message string, cause error) *IssueError
- func NewConfigurationError(message string, cause error) *IssueError
- func NewNetworkError(message string, cause error) *IssueError
- func NewNotFoundError(resource string) *IssueError
- func NewPermissionError(message string, cause error) *IssueError
- func NewRateLimitError(resetTime string) *IssueError
- func NewValidationError(message string, cause error) *IssueError
- func WrapError(err error, message string) *IssueError
- type IssueRequest
- type Label
- type ProjectItem
- type SearchClient
- func (s *SearchClient) FetchProjectIssues(projectID string, limit int) ([]filter.ProjectIssue, error)
- func (s *SearchClient) FilterProjectIssues(issues []filter.ProjectIssue, filters *filter.IssueFilters) []filter.ProjectIssue
- func (s *SearchClient) GetProjectIssues(projectID string) ([]filter.GitHubIssue, error)
- func (s *SearchClient) SearchIssues(filters *filter.IssueFilters) ([]filter.GitHubIssue, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchError ¶
type BatchError struct {
Index int `json:"index"`
Title string `json:"title"`
Error string `json:"error"`
}
BatchError represents an error during batch processing
type BatchResult ¶
type BatchResult struct {
Total int `json:"total"`
Succeeded int `json:"succeeded"`
Failed int `json:"failed"`
Issues []*Issue `json:"issues"`
Errors []BatchError `json:"errors,omitempty"`
}
BatchResult represents the result of batch issue creation
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper around GitHub API client for issue operations
func (*Client) AddToProject ¶
AddToProject adds an issue to a project and returns the project item ID
func (*Client) AddToProjectWithDatabaseID ¶ added in v0.0.3
AddToProjectWithDatabaseID adds an issue to a project and returns both IDs
func (*Client) CreateIssue ¶
func (c *Client) CreateIssue(req IssueRequest) (Issue, error)
CreateIssueFromRequest creates a new issue from IssueRequest
func (*Client) CreateIssueWithData ¶ added in v0.6.0
CreateIssueWithData creates a new issue - delegates to Creator
func (*Client) CreateIssueWithRepo ¶ added in v0.6.0
func (c *Client) CreateIssueWithRepo(req IssueRequest, repo string) (Issue, error)
CreateIssueWithRepo creates a new issue in a specific repo
func (*Client) GetGraphQLClient ¶ added in v0.5.0
func (c *Client) GetGraphQLClient() *api.GraphQLClient
GetGraphQLClient returns the GraphQL client for direct use
func (*Client) GetIssueWithRepo ¶ added in v0.6.0
GetIssueWithRepo fetches an issue by number from a specific repo
func (*Client) GetProjectItemID ¶ added in v0.3.0
GetProjectItemID gets the project item ID for an issue if it exists in the project
func (*Client) UpdateIssue ¶ added in v0.6.0
func (c *Client) UpdateIssue(number int, req IssueRequest) error
UpdateIssue updates an existing issue
func (*Client) UpdateIssueWithRepo ¶ added in v0.6.0
func (c *Client) UpdateIssueWithRepo(number int, req IssueRequest, repo string) error
UpdateIssueWithRepo updates an existing issue in a specific repo
func (*Client) UpdateProjectItemField ¶
UpdateProjectItemField updates a single field value for a project item
type Comment ¶ added in v0.0.5
type Comment struct {
ID string `json:"id"`
Author string `json:"author"`
Body string `json:"body"`
CreatedAt time.Time `json:"created_at"`
}
Comment represents a comment on an issue
type Creator ¶
type Creator struct {
// contains filtered or unexported fields
}
Creator handles issue creation and project management
func (*Creator) AddToProject ¶
AddToProject adds an issue to a GitHub Project v2
func (*Creator) CreateIssue ¶
CreateIssue creates a new GitHub issue
func (*Creator) GetProjectItemID ¶
GetProjectItemID retrieves the project item ID for an issue
type ErrorType ¶
type ErrorType int
ErrorType represents the type of error that occurred
const ( // ErrorTypeValidation indicates a validation error ErrorTypeValidation ErrorType = iota // ErrorTypeConfiguration indicates a configuration error ErrorTypeConfiguration // ErrorTypePermission indicates a permission/authorization error ErrorTypePermission // ErrorTypeNetwork indicates a network connectivity error ErrorTypeNetwork // ErrorTypeRateLimit indicates GitHub API rate limit error ErrorTypeRateLimit // ErrorTypeNotFound indicates a resource was not found ErrorTypeNotFound // ErrorTypeAPI indicates a general API error ErrorTypeAPI )
type Issue ¶
type Issue struct {
ID string `json:"id"`
Number int `json:"number"`
Title string `json:"title"`
Body string `json:"body,omitempty"`
URL string `json:"url"`
State string `json:"state"`
Repository string `json:"repository"`
Labels []Label `json:"labels"`
Assignees []string `json:"assignees,omitempty"`
Milestone string `json:"milestone,omitempty"`
ProjectItem *ProjectItem `json:"project_item,omitempty"`
ProjectURL string `json:"project_url,omitempty"`
Comments []Comment `json:"comments,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Issue represents a created GitHub issue with project metadata
type IssueData ¶
type IssueData struct {
Title string `yaml:"title" json:"title"`
Body string `yaml:"body" json:"body"`
Labels []string `yaml:"labels" json:"labels"`
Repository string `yaml:"repository" json:"repository"`
Priority string `yaml:"priority" json:"priority"`
Status string `yaml:"status" json:"status"`
CustomFields map[string]string `yaml:"custom_fields" json:"custom_fields"`
// Pass-through fields for gh issue create compatibility
Assignee string `yaml:"assignee" json:"assignee"`
Milestone string `yaml:"milestone" json:"milestone"`
}
IssueData represents the data needed to create an issue
func (*IssueData) GetFieldUpdates ¶
GetFieldUpdates returns project field updates
func (*IssueData) ToCreateRequest ¶
ToCreateRequest converts IssueData to a format suitable for GitHub API
type IssueError ¶
IssueError represents a structured error with type and suggestion
func NewAPIError ¶
func NewAPIError(message string, cause error) *IssueError
NewAPIError creates a new general API error
func NewConfigurationError ¶
func NewConfigurationError(message string, cause error) *IssueError
NewConfigurationError creates a new configuration error
func NewNetworkError ¶
func NewNetworkError(message string, cause error) *IssueError
NewNetworkError creates a new network error
func NewNotFoundError ¶
func NewNotFoundError(resource string) *IssueError
NewNotFoundError creates a new not found error
func NewPermissionError ¶
func NewPermissionError(message string, cause error) *IssueError
NewPermissionError creates a new permission error
func NewRateLimitError ¶
func NewRateLimitError(resetTime string) *IssueError
NewRateLimitError creates a new rate limit error with reset time
func NewValidationError ¶
func NewValidationError(message string, cause error) *IssueError
NewValidationError creates a new validation error
func WrapError ¶
func WrapError(err error, message string) *IssueError
WrapError wraps an existing error with additional context
func (*IssueError) Is ¶
func (e *IssueError) Is(target error) bool
Is checks if the error is of a specific type
type IssueRequest ¶ added in v0.6.0
type IssueRequest struct {
Title string `json:"title"`
Body string `json:"body"`
Labels []string `json:"labels"`
Assignees []string `json:"assignees"`
Milestone string `json:"milestone"`
}
IssueRequest represents the data for creating/updating an issue
type ProjectItem ¶
type ProjectItem struct {
ID string `json:"id"`
DatabaseID int `json:"database_id"`
ProjectID string `json:"project_id"`
Fields map[string]interface{} `json:"fields"`
}
ProjectItem represents an issue's connection to a project
type SearchClient ¶ added in v0.6.6
type SearchClient struct {
// contains filtered or unexported fields
}
SearchClient handles issue searching and filtering operations
func NewSearchClient ¶ added in v0.6.6
func NewSearchClient(cfg *config.Config) (*SearchClient, error)
NewSearchClient creates a new SearchClient
func (*SearchClient) FetchProjectIssues ¶ added in v0.6.6
func (s *SearchClient) FetchProjectIssues(projectID string, limit int) ([]filter.ProjectIssue, error)
FetchProjectIssues fetches project issues with field values and applies filtering
func (*SearchClient) FilterProjectIssues ¶ added in v0.6.6
func (s *SearchClient) FilterProjectIssues(issues []filter.ProjectIssue, filters *filter.IssueFilters) []filter.ProjectIssue
FilterProjectIssues applies local filtering to project issues
func (*SearchClient) GetProjectIssues ¶ added in v0.6.6
func (s *SearchClient) GetProjectIssues(projectID string) ([]filter.GitHubIssue, error)
GetProjectIssues fetches all issues in the specified project
func (*SearchClient) SearchIssues ¶ added in v0.6.6
func (s *SearchClient) SearchIssues(filters *filter.IssueFilters) ([]filter.GitHubIssue, error)
SearchIssues searches for issues using GitHub API with the provided filters