github

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultBaseURL is the default GitHub API base URL
	DefaultBaseURL = "https://api.github.com"

	// TokenEnv is the environment variable for GitHub token
	TokenEnv = "GITHUB_TOKEN"

	// HolonTokenEnv is the environment variable for Holon-specific GitHub token
	// This has higher priority than GITHUB_TOKEN to allow overriding CI's GITHUB_TOKEN
	// with a token that has higher permissions (e.g., holonbot app token).
	HolonTokenEnv = "HOLON_GITHUB_TOKEN"

	// DefaultTimeout is the default HTTP timeout
	DefaultTimeout = 30 * time.Second
)
View Source
const (
	// HolonRepoOwner is the GitHub repository owner for Holon
	HolonRepoOwner = "holon-run"
	// HolonRepoName is the GitHub repository name for Holon
	HolonRepoName = "holon"
	// VersionCheckCacheFile is the filename for the version check cache
	VersionCheckCacheFile = "version_check_cache.json"
	// VersionCheckCacheTTL is the time-to-live for the version check cache (24 hours)
	VersionCheckCacheTTL = 24 * time.Hour
	// VersionCheckEnvVar is the environment variable to disable version checking
	VersionCheckEnvVar = "HOLON_NO_VERSION_CHECK"
)

Variables

This section is empty.

Functions

func GetTokenFromEnv

func GetTokenFromEnv() (string, bool)

GetTokenFromEnv retrieves a GitHub token from environment variables or gh CLI. Priority order (highest to lowest): 1. HOLON_GITHUB_TOKEN - Holon-specific token (allows overriding CI's GITHUB_TOKEN) 2. GITHUB_TOKEN - standard GitHub token (automatically set in CI environments) 3. gh auth token - fallback to gh CLI token

Returns the token and a boolean indicating whether the token came from gh CLI.

func IsAuthenticationError

func IsAuthenticationError(err error) bool

IsAuthenticationError returns true if the error is an authentication error

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError returns true if the error is a not found error

func IsRateLimitError

func IsRateLimitError(err error) bool

IsRateLimitError returns true if the error is a rate limit error

func IsRetryableError

func IsRetryableError(err error) bool

IsRetryableError checks if an error is retryable

func IsValidGitHubRef

func IsValidGitHubRef(ref string) bool

IsValidGitHubRef validates if a string is a valid GitHub reference format

Types

type APIError

type APIError struct {
	StatusCode int
	Message    string
	Errors     []APIErrorDetail `json:"errors,omitempty"`
	// Rate limit information when rate limited
	RateLimit *RateLimitInfo
}

APIError represents a GitHub API error response

func (*APIError) Error

func (e *APIError) Error() string

Error returns the error message

type APIErrorDetail

type APIErrorDetail struct {
	Resource string `json:"resource"`
	Field    string `json:"field"`
	Code     string `json:"code"`
	Message  string `json:"message"`
}

APIErrorDetail represents individual error details from GitHub

type ActorInfo

type ActorInfo struct {
	Login   string `json:"login"`              // Username or app name
	Type    string `json:"type"`               // "User" or "App"
	Source  string `json:"source,omitempty"`   // "token" or "app"
	AppSlug string `json:"app_slug,omitempty"` // App slug if type is "App"
}

ActorInfo represents the authenticated GitHub user or app

type CheckRun

type CheckRun struct {
	ID           int64          `json:"id"`
	Name         string         `json:"name"`
	HeadSHA      string         `json:"head_sha"`
	Status       string         `json:"status"`     // queued, in_progress, completed
	Conclusion   string         `json:"conclusion"` // success, failure, neutral, cancelled, skipped, timed_out, action_required
	StartedAt    *time.Time     `json:"started_at,omitempty"`
	CompletedAt  *time.Time     `json:"completed_at,omitempty"`
	DetailsURL   string         `json:"details_url,omitempty"`
	AppSlug      string         `json:"app_slug,omitempty"` // e.g., "github-actions"
	CheckSuiteID int64          `json:"check_suite_id,omitempty"`
	Output       CheckRunOutput `json:"output,omitempty"`
}

CheckRun represents a GitHub check run

type CheckRunOutput

type CheckRunOutput struct {
	Title   string `json:"title,omitempty"`
	Summary string `json:"summary,omitempty"`
	Text    string `json:"text,omitempty"`
}

CheckRunOutput represents the output of a check run

type CheckRunsResponse

type CheckRunsResponse struct {
	TotalCount int        `json:"total_count"`
	CheckRuns  []CheckRun `json:"check_runs"`
}

CheckRunsResponse is the API response for check runs

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a unified GitHub API client that supports both direct HTTP and go-github.

The client provides: - Direct HTTP access via NewRequest/Do methods - Lazy-loaded go-github client via GitHubClient() for advanced operations - Automatic rate limit tracking (when enabled via WithRateLimitTracking) - Retry logic with exponential backoff (when configured via WithRetryConfig)

Example:

client := github.NewClient(token,
    github.WithRateLimitTracking(true),
    github.WithRetryConfig(github.DefaultRetryConfig()),
)

func NewClient

func NewClient(token string, opts ...ClientOption) *Client

NewClient creates a new GitHub API client with the given token

func NewClientFromEnv

func NewClientFromEnv(opts ...ClientOption) (*Client, error)

NewClientFromEnv creates a new client using token from environment variables or gh CLI. It checks HOLON_GITHUB_TOKEN and GITHUB_TOKEN environment variables first. If those are empty, it attempts to use `gh auth token` as a fallback.

func (*Client) CreateIssue

func (c *Client) CreateIssue(ctx context.Context, owner, repo, title, body string, labels []string) (string, error)

CreateIssue creates a new GitHub issue

func (*Client) CreateIssueComment

func (c *Client) CreateIssueComment(ctx context.Context, owner, repo string, issueNumber int, body string) (int64, error)

CreateIssueComment creates a new comment on an issue or PR

func (*Client) CreatePullRequest

func (c *Client) CreatePullRequest(ctx context.Context, owner, repo string, newPR *NewPullRequest) (*PRInfo, error)

CreatePullRequest creates a new pull request

func (*Client) CreatePullRequestComment

func (c *Client) CreatePullRequestComment(ctx context.Context, owner, repo string, prNumber int, body string, inReplyTo int64) (int64, error)

CreatePullRequestComment creates a reply to a review comment

func (*Client) Do

func (c *Client) Do(req *http.Request, result interface{}) (*ClientResponse, error)

Do sends an HTTP request and returns the response

func (*Client) EditIssueComment

func (c *Client) EditIssueComment(ctx context.Context, owner, repo string, commentID int64, body string) error

EditIssueComment edits an existing issue or PR comment

func (*Client) FetchCheckRuns

func (c *Client) FetchCheckRuns(ctx context.Context, owner, repo, ref string, maxResults int) ([]CheckRun, error)

FetchCheckRuns fetches check runs for a commit ref using go-github SDK

func (*Client) FetchCombinedStatus

func (c *Client) FetchCombinedStatus(ctx context.Context, owner, repo, ref string) (*CombinedStatus, error)

FetchCombinedStatus fetches the combined status for a commit ref using go-github SDK

func (*Client) FetchIssueComments

func (c *Client) FetchIssueComments(ctx context.Context, owner, repo string, issueNumber int) ([]IssueComment, error)

FetchIssueComments fetches comments for an issue with pagination using go-github SDK

func (*Client) FetchIssueInfo

func (c *Client) FetchIssueInfo(ctx context.Context, owner, repo string, issueNumber int) (*IssueInfo, error)

FetchIssueInfo fetches basic issue information using go-github SDK

func (*Client) FetchLatestHolonRelease

func (c *Client) FetchLatestHolonRelease(ctx context.Context, owner, repo string) (*ReleaseInfo, error)

FetchLatestHolonRelease fetches the latest Holon CLI release from GitHub This filters out draft/prerelease releases and returns only releases starting with 'v'

func (*Client) FetchLatestRelease

func (c *Client) FetchLatestRelease(ctx context.Context, owner, repo string) (*ReleaseInfo, error)

FetchLatestRelease fetches the latest release from GitHub Uses direct HTTP to avoid go-github dependency for this simple operation

func (*Client) FetchPRDiff

func (c *Client) FetchPRDiff(ctx context.Context, owner, repo string, prNumber int) (string, error)

FetchPRDiff fetches the unified diff for a PR using go-github SDK

func (*Client) FetchPRInfo

func (c *Client) FetchPRInfo(ctx context.Context, owner, repo string, prNumber int) (*PRInfo, error)

FetchPRInfo fetches basic pull request information using go-github SDK

func (*Client) FetchReviewThreads

func (c *Client) FetchReviewThreads(ctx context.Context, owner, repo string, prNumber int, unresolvedOnly bool) ([]ReviewThread, error)

FetchReviewThreads fetches review comment threads for a PR using go-github SDK

func (*Client) FetchWorkflowLogs added in v0.6.0

func (c *Client) FetchWorkflowLogs(ctx context.Context, detailsURL string) ([]byte, error)

FetchWorkflowLogs downloads logs for a GitHub Actions workflow run. The detailsURL should be the check run's DetailsURL (e.g., "https://github.com/owner/repo/actions/runs/12345/job/67890"). This function extracts the workflow run ID and uses the GitHub Actions API to download the logs. Returns the log content as bytes (ZIP archive contents).

func (*Client) GetCurrentUser

func (c *Client) GetCurrentUser(ctx context.Context) (*ActorInfo, error)

GetCurrentUser retrieves the authenticated user's identity information Returns ActorInfo with login and type (User or App) Handles both PAT/user tokens (via /user endpoint) and GitHub App tokens (via /app endpoint) Returns nil if the request fails (non-critical operation)

func (*Client) GetRateLimitStatus

func (c *Client) GetRateLimitStatus() (RateLimitStatus, error)

GetRateLimitStatus returns the current rate limit status

func (*Client) GetToken

func (c *Client) GetToken() string

GetToken returns the client's authentication token

func (*Client) GitHubClient

func (c *Client) GitHubClient() *github.Client

GitHubClient returns the underlying go-github client (lazy-loaded)

func (*Client) ListIssueComments

func (c *Client) ListIssueComments(ctx context.Context, owner, repo string, issueNumber int) ([]IssueComment, error)

ListIssueComments lists all issue/PR comments with pagination

func (*Client) ListPullRequestComments

func (c *Client) ListPullRequestComments(ctx context.Context, owner, repo string, prNumber int) ([]*github.PullRequestComment, error)

ListPullRequestComments lists all PR review comments with pagination

func (*Client) ListPullRequests

func (c *Client) ListPullRequests(ctx context.Context, owner, repo string, state string) ([]*PRInfo, error)

ListPullRequests lists all pull requests with optional filters

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method, url string, body io.Reader) (*http.Request, error)

NewRequest creates a new HTTP request with proper authentication

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(baseURL string)

SetBaseURL updates the base URL for the GitHub API

func (*Client) SetToken

func (c *Client) SetToken(token string)

SetToken updates the client's authentication token

func (*Client) UpdatePullRequest

func (c *Client) UpdatePullRequest(ctx context.Context, owner, repo string, prNumber int, title, body string) (*PRInfo, error)

UpdatePullRequest updates an existing pull request

type ClientOption

type ClientOption func(*Client)

ClientOption configures a Client

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL sets a custom base URL for the GitHub API

func WithHTTPClient

func WithHTTPClient(client *http.Client) ClientOption

WithHTTPClient sets a custom HTTP client

func WithRateLimitTracking

func WithRateLimitTracking(enabled bool) ClientOption

WithRateLimitTracking enables rate limit tracking

func WithRetryConfig

func WithRetryConfig(config *RetryConfig) ClientOption

WithRetryConfig configures retry behavior

func WithTimeout

func WithTimeout(timeout time.Duration) ClientOption

WithTimeout sets a custom HTTP timeout

type ClientResponse

type ClientResponse struct {
	*http.Response
	// contains filtered or unexported fields
}

ClientResponse wraps an HTTP response with additional methods

func (*ClientResponse) Close

func (r *ClientResponse) Close() error

Close closes the response body (idempotent)

func (*ClientResponse) DecodeJSON

func (r *ClientResponse) DecodeJSON(v interface{}) error

DecodeJSON decodes the response body as JSON

func (*ClientResponse) ReadAll

func (r *ClientResponse) ReadAll() ([]byte, error)

ReadAll reads the entire response body

type CombinedStatus

type CombinedStatus struct {
	SHA        string   `json:"sha"`
	State      string   `json:"state"` // pending, success, failure, error
	TotalCount int      `json:"total_count"`
	Statuses   []Status `json:"statuses"`
}

CombinedStatus represents the combined status for a ref

type IssueComment

type IssueComment struct {
	CommentID int64     `json:"comment_id"`
	URL       string    `json:"url"`
	Body      string    `json:"body"`
	Author    string    `json:"author"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

IssueComment represents a comment on an issue

type IssueInfo

type IssueInfo struct {
	Number     int       `json:"number"`
	Title      string    `json:"title"`
	Body       string    `json:"body"`
	State      string    `json:"state"`
	URL        string    `json:"url"`
	Author     string    `json:"author"`
	Assignee   string    `json:"assignee,omitempty"`
	CreatedAt  time.Time `json:"created_at"`
	UpdatedAt  time.Time `json:"updated_at"`
	Repository string    `json:"repository"`
	Labels     []string  `json:"labels,omitempty"`
}

IssueInfo contains basic issue information

type ListOptions

type ListOptions struct {
	Page      int       `json:"page"`                // Page number (1-based)
	PerPage   int       `json:"per_page"`            // Number of items per page (max 100, default 30)
	Since     time.Time `json:"since,omitempty"`     // Only show items updated after this time
	State     string    `json:"state,omitempty"`     // Filter by state (e.g., "open", "closed", "all")
	Sort      string    `json:"sort,omitempty"`      // Sort field (e.g., "created", "updated")
	Direction string    `json:"direction,omitempty"` // Sort direction (asc, desc)
}

ListOptions defines pagination options for listing resources

func DefaultListOptions

func DefaultListOptions() *ListOptions

DefaultListOptions returns default pagination options

func (*ListOptions) ApplyToURL

func (lo *ListOptions) ApplyToURL(baseURL string) string

ApplyToURL applies list options to a URL as query parameters

type NewPullRequest

type NewPullRequest struct {
	Title               string `json:"title"`
	Head                string `json:"head"`
	Base                string `json:"base"`
	Body                string `json:"body"`
	MaintainerCanModify bool   `json:"maintainer_can_modify"`
}

NewPullRequest contains information for creating a new pull request

type PRInfo

type PRInfo struct {
	Number      int       `json:"number"`
	Title       string    `json:"title"`
	Body        string    `json:"body"`
	State       string    `json:"state"`
	URL         string    `json:"url"`
	BaseRef     string    `json:"base_ref"`
	HeadRef     string    `json:"head_ref"`
	BaseSHA     string    `json:"base_sha"`
	HeadSHA     string    `json:"head_sha"`
	Author      string    `json:"author"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
	Repository  string    `json:"repository"`
	MergeCommit string    `json:"merge_commit_sha,omitempty"`
}

PRInfo contains basic pull request information

type PageResult

type PageResult struct {
	Items    interface{} `json:"items"`           // The items in this page
	Response *Response   `json:"response"`        // Response metadata
	HasMore  bool        `json:"has_more"`        // Whether there are more pages
	Error    error       `json:"error,omitempty"` // Any error that occurred
}

PageResult represents a single page of results

type Paginator

type Paginator struct {
	// contains filtered or unexported fields
}

Paginator handles pagination for GitHub API requests

func NewPaginator

func NewPaginator(client *Client, opts *ListOptions) *Paginator

NewPaginator creates a new paginator

func (*Paginator) FetchAll

func (p *Paginator) FetchAll(ctx context.Context, urlStr string) ([]interface{}, error)

FetchAll fetches all pages and returns a combined list

func (*Paginator) FetchPage

func (p *Paginator) FetchPage(ctx context.Context, urlStr string, page int) (*PageResult, error)

FetchPage fetches a single page of results

func (*Paginator) FetchPageChan

func (p *Paginator) FetchPageChan(ctx context.Context, url string) <-chan *PageResult

FetchPageChan returns a channel that yields pages as they are fetched

func (*Paginator) SetMaxResults

func (p *Paginator) SetMaxResults(max int)

SetMaxResults sets the maximum number of results to fetch

type RateLimitInfo

type RateLimitInfo struct {
	Limit     int
	Remaining int
	Reset     int64 // Unix timestamp
	Used      int
}

RateLimitInfo contains rate limit information from response headers

type RateLimitStatus

type RateLimitStatus struct {
	Limit     int       `json:"limit"`
	Remaining int       `json:"remaining"`
	Reset     time.Time `json:"reset"`
	Used      int       `json:"used"`
}

RateLimitStatus represents the current rate limit status

type RateLimitTracker

type RateLimitTracker struct {
	// contains filtered or unexported fields
}

RateLimitTracker tracks rate limit information from GitHub API responses

func NewRateLimitTracker

func NewRateLimitTracker() *RateLimitTracker

NewRateLimitTracker creates a new rate limit tracker

func (*RateLimitTracker) GetStatus

func (r *RateLimitTracker) GetStatus() RateLimitStatus

GetStatus returns a copy of the current rate limit status

func (*RateLimitTracker) Update

func (r *RateLimitTracker) Update(resp *http.Response)

Update updates the rate limit status from HTTP response headers

func (*RateLimitTracker) WaitForRateLimitReset

func (r *RateLimitTracker) WaitForRateLimitReset(ctx context.Context) error

WaitForRateLimitReset waits until the rate limit resets if necessary

type Recorder

type Recorder struct {
	// contains filtered or unexported fields
}

Recorder wraps go-vcr recorder with Holon-specific functionality

func NewRecorder

func NewRecorder(t *testing.T, name string) (*Recorder, error)

NewRecorder creates a new VCR recorder for testing GitHub API interactions.

The recorder will: - In replay mode (default): Use recorded fixtures from testdata/fixtures/ - In record mode (HOLON_VCR_MODE=record): Record new API interactions to fixtures

Usage:

rec, err := NewRecorder(t, "fixture_name")
if err != nil {
    t.Fatal(err)
}
defer rec.Stop()

client := NewClient("test-token")
client.httpClient = rec.HTTPClient()

IMPORTANT: When recording new fixtures, you must set a real GitHub token:

HOLON_VCR_MODE=record GITHUB_TOKEN=your_token go test ./pkg/github/...

func (*Recorder) HTTPClient

func (r *Recorder) HTTPClient() *http.Client

HTTPClient returns an HTTP client configured to use the recorder

func (*Recorder) IsRecording

func (r *Recorder) IsRecording() bool

IsRecording returns true if we're in record mode

func (*Recorder) Mode

func (r *Recorder) Mode() recorderMode

Mode returns the current recorder mode

func (*Recorder) Stop

func (r *Recorder) Stop() error

Stop stops the recorder

type Ref

type Ref struct {
	Owner      string
	Repo       string
	Number     int
	Kind       RefType
	BaseBranch string // For repo refs (e.g., owner/repo:main)
}

Ref represents a parsed GitHub reference

func ParseRef

func ParseRef(target string) (*Ref, error)

ParseRef parses a GitHub reference string into its components. Supported formats:

  • owner/repo/pr/123 (PR reference)
  • owner/repo#123 (PR reference)
  • owner/repo/pull/123 (PR reference)
  • owner/repo:base_branch (Repository reference with base branch)

func (*Ref) String

func (r *Ref) String() string

String returns the string representation of the reference

type RefType

type RefType int

RefType represents the type of GitHub reference

const (
	// RefTypePR is a pull request reference
	RefTypePR RefType = iota
	// RefTypeIssue is an issue reference
	RefTypeIssue
	// RefTypeRepo is a repository reference
	RefTypeRepo
)

type ReleaseInfo

type ReleaseInfo struct {
	TagName     string    `json:"tag_name"`
	Name        string    `json:"name"`
	Draft       bool      `json:"draft"`
	Prerelease  bool      `json:"prerelease"`
	PublishedAt time.Time `json:"published_at"`
	HTMLURL     string    `json:"html_url"`
}

ReleaseInfo represents information about a GitHub release

func CheckForUpdates

func CheckForUpdates(ctx context.Context, currentVersion string) (*ReleaseInfo, bool, error)

CheckForUpdates checks if a newer version of Holon is available Returns the latest version info and whether the current version is up to date

type Reply

type Reply struct {
	CommentID   int64     `json:"comment_id"`
	URL         string    `json:"url"`
	Body        string    `json:"body"`
	Author      string    `json:"author"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
	InReplyToID int64     `json:"in_reply_to_id"`
}

Reply represents a reply to a review comment

type Response

type Response struct {
	// The number of items returned in this response
	Count int

	// The total number of items across all pages (if available)
	TotalCount int

	// Information about the next page
	NextPage int

	// Information about the previous page
	PrevPage int

	// The first page number
	FirstPage int

	// The last page number
	LastPage int

	// Rate limit information
	RateLimit *RateLimitStatus
}

Response represents a paginated GitHub API response

type RetryConfig

type RetryConfig struct {
	MaxAttempts int           // Maximum number of retry attempts
	BaseDelay   time.Duration // Base delay between retries
	MaxDelay    time.Duration // Maximum delay between retries
	RetryOn     []int         // HTTP status codes to retry on
}

RetryConfig defines retry behavior for failed requests

func DefaultRetryConfig

func DefaultRetryConfig() *RetryConfig

DefaultRetryConfig returns the default retry configuration

func (*RetryConfig) GetDelay

func (rc *RetryConfig) GetDelay(attempt int) time.Duration

GetDelay calculates the delay for a given retry attempt with exponential backoff

func (*RetryConfig) ShouldRetry

func (rc *RetryConfig) ShouldRetry(statusCode int) bool

ShouldRetry returns true if the request should be retried based on the status code

type ReviewThread

type ReviewThread struct {
	CommentID   int64     `json:"comment_id"`
	URL         string    `json:"url"`
	Path        string    `json:"path"`
	Line        int       `json:"line,omitempty"`
	Side        string    `json:"side,omitempty"`
	StartLine   int       `json:"start_line,omitempty"`
	StartSide   string    `json:"start_side,omitempty"`
	DiffHunk    string    `json:"diff_hunk"`
	Body        string    `json:"body"`
	Author      string    `json:"author"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
	Resolved    bool      `json:"resolved"`
	InReplyToID int64     `json:"in_reply_to_id,omitempty"`
	Position    int       `json:"position,omitempty"`
	Replies     []Reply   `json:"replies,omitempty"`
}

ReviewThread represents a review comment thread

type SolveRef

type SolveRef struct {
	Owner  string
	Repo   string
	Number int
	Type   SolveRefType
}

SolveRef represents a parsed GitHub reference for solving

func ParseSolveRef

func ParseSolveRef(ref string, defaultRepo string) (*SolveRef, error)

ParseSolveRef parses a GitHub reference string for the solve command. Supported formats:

  • https://github.com/<owner>/<repo>/issues/<n> (issue URL)
  • https://github.com/<owner>/<repo>/pull/<n> (PR URL)
  • <owner>/<repo>#<n> (short form, type determined later via API)
  • #<n> or <n> (numeric only, requires --repo flag)

For ambiguous references (short forms), the Type field may be unknown and should be determined via GitHub API by checking if the number is a PR.

func (*SolveRef) String

func (r *SolveRef) String() string

String returns the string representation of the solve reference

func (*SolveRef) URL

func (r *SolveRef) URL() string

URL returns the GitHub URL for this reference. Falls back to issues URL for unknown types (should not occur in normal usage).

type SolveRefType

type SolveRefType int

SolveRefType represents the type of GitHub reference for solving

const (
	// SolveRefTypeIssue is an issue reference
	SolveRefTypeIssue SolveRefType = iota
	// SolveRefTypePR is a pull request reference
	SolveRefTypePR
)

type Status

type Status struct {
	ID          int64     `json:"id"`
	Context     string    `json:"context"` // e.g., "ci/travis-ci", "coverage/coveralls"
	State       string    `json:"state"`   // pending, success, failure, error
	TargetURL   string    `json:"target_url,omitempty"`
	Description string    `json:"description,omitempty"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

Status represents an individual status

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL