Documentation
¶
Index ¶
- Variables
- func CIStatusFromMergeableState(mergeableState string) string
- func CheckGHVersion() (string, error)
- func FetchPullRequestFeedback(ctx context.Context, transport QueryTransport, repo string, number int) ([]prreadiness.FeedbackItem, []prreadiness.ThreadState, error)
- func FetchPullRequestReadiness(ctx context.Context, transport QueryTransport, repo string, number int) (*prreadiness.Observation, error)
- func GetTokenForHost(ctx context.Context, host string) (string, error)
- func GitHTTPSAuthorizationHeader(token string) string
- func InstallHint() string
- func RequireGHVersion(minVersion string) error
- func UpgradeHint() string
- type Client
- func (c *Client) ApprovePR(repo string, number int) error
- func (c *Client) FetchAll() ([]*protocol.PR, error)
- func (c *Client) FetchPRDetails(repo string, number int) (*PRDetails, error)
- func (c *Client) FetchPRState(ctx context.Context, repo string, number int) (state string, merged bool, title string, err error)
- func (c *Client) FetchPullRequestFeedback(ctx context.Context, repo string, number int) ([]prreadiness.FeedbackItem, []prreadiness.ThreadState, error)
- func (c *Client) FetchPullRequestReadiness(ctx context.Context, repo string, number int) (*prreadiness.Observation, error)
- func (c *Client) FetchPullRequestReviewStatus(repo string, number int) (string, error)
- func (c *Client) FetchPullRequestSnapshot(repo string, number int) (*PullRequestSnapshot, error)
- func (c *Client) GetRateLimit(resource string) *RateLimitInfo
- func (c *Client) GitHTTPSAuthorizationHeader() string
- func (c *Client) GraphQL(ctx context.Context, query string, variables map[string]any) ([]byte, error)
- func (c *Client) Host() string
- func (c *Client) IsAvailable() bool
- func (c *Client) IsRateLimited(resource string) (bool, time.Time)
- func (c *Client) ListMergedPullRequests(repo string) ([]MergedPullRequest, error)
- func (c *Client) ListMergedPullRequestsContext(ctx context.Context, repo string) ([]MergedPullRequest, error)
- func (c *Client) MergePR(repo string, number int, method string) error
- func (c *Client) RepoVisibility(repo string) (string, error)
- func (c *Client) SearchAuthoredPRs() ([]*protocol.PR, error)
- func (c *Client) SearchReviewRequestedPRs() ([]*protocol.PR, error)
- func (c *Client) SearchReviewedByMePRs() ([]*protocol.PR, error)
- type ClientRegistry
- type GitHubClient
- type HostInfo
- type MergedPullRequest
- type PRDetails
- type PullRequestSnapshot
- type QueryTransport
- type RateLimitInfo
- type VersionTooOldError
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoToken = errors.New("no GitHub token available")
View Source
var ErrRateLimited = errors.New("GitHub rate limit exceeded")
View Source
var ErrReadinessHeadChanged = errors.New("pull request head changed while reading readiness")
View Source
var ErrSelfRateLimited = errors.New("self-imposed rate limit exceeded")
Functions ¶
func CIStatusFromMergeableState ¶ added in v0.12.0
func CheckGHVersion ¶
func FetchPullRequestFeedback ¶ added in v0.12.0
func FetchPullRequestFeedback(ctx context.Context, transport QueryTransport, repo string, number int) ([]prreadiness.FeedbackItem, []prreadiness.ThreadState, error)
func FetchPullRequestReadiness ¶ added in v0.12.0
func FetchPullRequestReadiness(ctx context.Context, transport QueryTransport, repo string, number int) (*prreadiness.Observation, error)
func GitHTTPSAuthorizationHeader ¶ added in v0.12.0
func InstallHint ¶ added in v0.12.0
func InstallHint() string
func RequireGHVersion ¶
func UpgradeHint ¶ added in v0.12.0
func UpgradeHint() string
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientForHost ¶
func (*Client) FetchPRDetails ¶
func (*Client) FetchPRState ¶ added in v0.12.0
func (*Client) FetchPullRequestFeedback ¶ added in v0.12.0
func (c *Client) FetchPullRequestFeedback(ctx context.Context, repo string, number int) ([]prreadiness.FeedbackItem, []prreadiness.ThreadState, error)
func (*Client) FetchPullRequestReadiness ¶ added in v0.12.0
func (c *Client) FetchPullRequestReadiness(ctx context.Context, repo string, number int) (*prreadiness.Observation, error)
func (*Client) FetchPullRequestReviewStatus ¶ added in v0.12.0
func (*Client) FetchPullRequestSnapshot ¶ added in v0.12.0
func (c *Client) FetchPullRequestSnapshot(repo string, number int) (*PullRequestSnapshot, error)
func (*Client) GetRateLimit ¶
func (c *Client) GetRateLimit(resource string) *RateLimitInfo
func (*Client) GitHTTPSAuthorizationHeader ¶ added in v0.12.0
func (*Client) IsAvailable ¶
func (*Client) ListMergedPullRequests ¶ added in v0.12.0
func (c *Client) ListMergedPullRequests(repo string) ([]MergedPullRequest, error)
func (*Client) ListMergedPullRequestsContext ¶ added in v0.12.0
func (*Client) RepoVisibility ¶ added in v0.12.0
func (*Client) SearchReviewRequestedPRs ¶
type ClientRegistry ¶
type ClientRegistry struct {
// contains filtered or unexported fields
}
func NewClientRegistry ¶
func NewClientRegistry() *ClientRegistry
func (*ClientRegistry) FetchAllPRs ¶
func (r *ClientRegistry) FetchAllPRs() ([]*protocol.PR, error)
func (*ClientRegistry) Hosts ¶
func (r *ClientRegistry) Hosts() []string
func (*ClientRegistry) Register ¶
func (r *ClientRegistry) Register(host string, client *Client)
func (*ClientRegistry) Remove ¶
func (r *ClientRegistry) Remove(host string)
type GitHubClient ¶
type GitHubClient interface {
Host() string
IsAvailable() bool
FetchAll() ([]*protocol.PR, error)
FetchPRDetails(repo string, number int) (*PRDetails, error)
ApprovePR(repo string, number int) error
MergePR(repo string, number int, method string) error
IsRateLimited(resource string) (bool, time.Time)
GetRateLimit(resource string) *RateLimitInfo
}
type MergedPullRequest ¶ added in v0.12.0
type PullRequestSnapshot ¶ added in v0.12.0
type QueryTransport ¶ added in v0.12.0
type VersionTooOldError ¶ added in v0.12.0
func (*VersionTooOldError) Error ¶ added in v0.12.0
func (e *VersionTooOldError) Error() string
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package githubschema checks GraphQL queries against GitHub's public schema, refreshed from https://docs.github.com/public/fpt/schema.docs.graphql.
|
Package githubschema checks GraphQL queries against GitHub's public schema, refreshed from https://docs.github.com/public/fpt/schema.docs.graphql. |
Click to show internal directories.
Click to hide internal directories.