Documentation
¶
Index ¶
- Variables
- type Client
- func (p *Client) CreateIssueComment(ctx context.Context, owner, repo string, number int, body string) error
- func (p *Client) GetIssueLabels(ctx context.Context, owner, repo string, number int) ([]string, error)
- func (p *Client) GetMostUpdatedIssues(ctx context.Context, request Request) (Response, error)
- func (p *Client) GetRepository(ctx context.Context, owner, repo string) (*github.Repository, error)
- func (p *Client) HasCommentWithMarker(ctx context.Context, owner, repo string, number int, marker string) (bool, error)
- type Cursor
- type DomainMapper
- type RateLimitError
- type Request
- type Response
- type ServerError
- type Transport
Constants ¶
This section is empty.
Variables ¶
var ErrUnexpectedNilResponse = errors.New("go-github returned nil response without error")
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.7.0
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateIssueComment ¶ added in v0.19.0
func (p *Client) CreateIssueComment(ctx context.Context, owner, repo string, number int, body string) error
CreateIssueComment posts a comment on a GitHub issue. Errors are classified via mapError (rate limit, 5xx, transport).
func (*Client) GetIssueLabels ¶ added in v0.19.0
func (p *Client) GetIssueLabels(ctx context.Context, owner, repo string, number int) ([]string, error)
GetIssueLabels fetches the labels on a GitHub issue. Returns an empty slice when the issue has no labels. Errors are classified via mapError (rate limit, 5xx, transport).
func (*Client) GetMostUpdatedIssues ¶ added in v0.7.0
GetMostUpdatedIssues fetches issues from the given repository, sorted by update time (oldest first).
The client is stateless per repository — owner and repo come from Request. Rate limiting is handled transparently by the underlying http.RoundTripper.
Returns a domain-facing Response that never exposes go-github types. Response.NotModified is true when the server returned 304 (ETag matched).
Errors are classified via mapError: rate limits → RateLimitError (implements apierr.Retryable, WaitHinted, ServicePressure), server errors (5xx) → ServerError (implements apierr.Retryable), transport errors → returned as-is (classified by longrun built-in transport classifier), permanent failures (401, 404, 422) → returned as-is.
func (*Client) GetRepository ¶ added in v0.12.0
GetRepository fetches repository metadata from GitHub API. Used by preflight to validate repository existence and accessibility.
func (*Client) HasCommentWithMarker ¶ added in v0.19.0
func (p *Client) HasCommentWithMarker(ctx context.Context, owner, repo string, number int, marker string) (bool, error)
HasCommentWithMarker checks whether any comment on the issue contains the given marker string. Used for feedback loop prevention: if autosolve already posted, skip re-processing. Fetches up to 100 comments per page and paginates until found or exhausted. Errors are classified via mapError (rate limit, 5xx, transport).
type Cursor ¶ added in v0.13.0
Cursor carries pagination and conditional-request state for a single API call. Built by the domain layer from entities.Offset; interpreted by Client.
type DomainMapper ¶ added in v0.13.0
type DomainMapper struct{}
func NewDomainMapper ¶ added in v0.13.0
func NewDomainMapper() *DomainMapper
type RateLimitError ¶ added in v0.13.0
RateLimitError is a domain-visible rate limit error. It carries RetryAfter so the caller can sleep precisely until the limit resets. Does NOT depend on go-github — domain imports only this type.
Implements apierr.Retryable, apierr.WaitHinted, apierr.ServicePressure.
func (*RateLimitError) Error ¶ added in v0.13.0
func (e *RateLimitError) Error() string
func (*RateLimitError) Retryable ¶ added in v0.14.0
func (e *RateLimitError) Retryable() bool
func (*RateLimitError) ServicePressure ¶ added in v0.14.0
func (e *RateLimitError) ServicePressure() bool
func (*RateLimitError) Unwrap ¶ added in v0.13.0
func (e *RateLimitError) Unwrap() error
func (*RateLimitError) WaitDuration ¶ added in v0.14.0
func (e *RateLimitError) WaitDuration() time.Duration
type Response ¶ added in v0.13.0
type Response struct {
// Issues contains the fetched domain entities. Nil when NotModified is true.
Issues []*entities.Issue
// NextCursor is the recommended cursor for the next request.
// The domain layer converts it to entities.Offset and persists via the topic.
NextCursor Cursor
// NotModified is true when the server returned 304 (ETag matched).
// Issues is nil and NextCursor is unchanged in this case.
NotModified bool
}
Response is the domain-facing result of a GitHub API call. It isolates the domain from go-github types — *github.Response never leaves this package.
type ServerError ¶ added in v0.14.0
ServerError represents a server-side failure (HTTP 5xx). The server acknowledged the request but failed to process it.
Implements apierr.Retryable.
func (*ServerError) Error ¶ added in v0.14.0
func (e *ServerError) Error() string
func (*ServerError) Retryable ¶ added in v0.14.0
func (e *ServerError) Retryable() bool
func (*ServerError) Unwrap ¶ added in v0.14.0
func (e *ServerError) Unwrap() error
type Transport ¶ added in v0.13.0
type Transport struct {
// contains filtered or unexported fields
}
Transport is an http.RoundTripper that ... TODO: add full responsibility description
func NewTransport ¶ added in v0.13.0
func NewTransport(throttler *limit.MinIntervalThrottler) *Transport