Versions in this module Expand all Collapse all v1 v1.5.1 Nov 6, 2026 v1.5.0 Nov 6, 2026 Changes in this version + const MaxResponseBodyBytes + const MaxResponseBytes + var ErrAmbiguousForge = errors.New("ambiguous forge") + var ErrConflict = errors.New("conflict") + var ErrNoToken = errors.New("no authentication token configured") + var ErrNotFound = errors.New("resource not found") + var ErrRateLimited = errors.New("rate limited") + var ErrUnsupportedForge = errors.New("unsupported forge") + func HandleResponse(resp *http.Response, authenticated bool) error + func HandleResponseStatus(statusCode int, authenticated bool) error + func IsConflict(err error) bool + func IsNoToken(err error) bool + func IsNotFound(err error) bool + func IsRateLimited(err error) bool + func LimitResponseBody(r io.Reader) io.Reader + func ReadResponse(resp *http.Response) ([]byte, error) + func ReadResponseBody(r io.Reader) ([]byte, error) + func RegisterAdapter(forge ForgeType, factory func(Options) (Client, error)) + type Client interface + AddComment func(ctx context.Context, ref IssueRef, body string) (string, error) + Authenticated func() bool + Close func() error + ListComments func(ctx context.Context, ref IssueRef) (CommentList, error) + ReadIssue func(ctx context.Context, ref IssueRef) (IssueThread, error) + func NewGitHub(o Options) (Client, error) + func NewGitLab(o Options) (Client, error) + func NewNoOp() Client + func NewWithOptions(o Options) (Client, error) + type Comment struct + Body string + CreatedAt time.Time + HTMLURL string + ID int64 + URL string + UpdatedAt time.Time + User User + type CommentList struct + Comments []Comment + Truncated bool + type ForgeType string + const ForgeTypeGitHub + const ForgeTypeGitLab + const ForgeTypeUnknown + func DetectForge(o Options) (ForgeType, error) + type HTTPError struct + Message string + Method string + Path string + RateLimitRemaining string + RateLimitReset string + RetryAfterHeader string + Status int + func HTTPErrorFromResponse(resp *http.Response) *HTTPError + func (e *HTTPError) Error() string + func (e *HTTPError) RetryAfter() (time.Duration, bool) + type Issue struct + Author User + Body string + ClosedAt *time.Time + CreatedAt time.Time + HTMLURL string + IsPR bool + Labels []string + Number int + State string + Title string + URL string + UpdatedAt time.Time + type IssueRef struct + IsPullRequest bool + Number int + Repo Repo + func ParseIssueURL(s string) (IssueRef, bool) + func (r IssueRef) String() string + func (r IssueRef) URL() string + type IssueThread struct + Comments []Comment + CommentsErr error + Issue Issue + Truncated bool + type NoOpClient struct + func (c *NoOpClient) AddComment(ctx context.Context, ref IssueRef, body string) (string, error) + func (c *NoOpClient) Authenticated() bool + func (c *NoOpClient) Close() error + func (c *NoOpClient) ListComments(ctx context.Context, ref IssueRef) (CommentList, error) + func (c *NoOpClient) ReadIssue(ctx context.Context, ref IssueRef) (IssueThread, error) + type Options struct + BaseURL string + Dir string + HTTPClient *http.Client + NoOp bool + RemoteURL string + Repo Repo + Token string + UserAgent string + type Repo struct + Host string + Name string + Owner string + func DetectRepo(dir string) (Repo, bool) + func ParseRemote(remote string) (Repo, bool) + func ParseRepo(s string) (Repo, bool) + func (r Repo) String() string + func (r Repo) Valid() bool + type User struct + Login string