Documentation
¶
Index ¶
- func ContainsSkipCI(s string) bool
- func FilterIgnorePath(files []string, pattern string) ([]string, error)
- func FilterPath(files []string, pattern string) ([]string, error)
- type CheckRequest
- type CheckResponse
- type CommitObject
- type GetParameters
- type GetRequest
- type GetResponse
- type Git
- type GitClient
- func (g *GitClient) Checkout(name string) error
- func (g *GitClient) Endpoint(uri string) (string, error)
- func (g *GitClient) Fetch(uri string, prNumber int) error
- func (g *GitClient) Init() error
- func (g *GitClient) Merge(sha string) error
- func (g *GitClient) Pull(uri string) error
- func (g *GitClient) RevParse(branch string) (string, error)
- type Github
- type GithubClient
- func (m *GithubClient) GetPullRequest(prNumber, commitRef string) (*PullRequest, error)
- func (m *GithubClient) ListModifiedFiles(prNumber int) ([]string, error)
- func (m *GithubClient) ListOpenPullRequests() ([]*PullRequest, error)
- func (m *GithubClient) PostComment(prNumber, comment string) error
- func (m *GithubClient) UpdateCommitStatus(commitRef, statusContext, status string) error
- type Metadata
- type MetadataField
- type PullRequest
- type PullRequestObject
- type PutParameters
- type PutRequest
- type PutResponse
- type Source
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsSkipCI ¶
ContainsSkipCI returns true if a string contains [ci skip] or [skip ci].
func FilterIgnorePath ¶
FilterIgnorePath ...
Types ¶
type CheckRequest ¶
CheckRequest ...
type CheckResponse ¶
type CheckResponse []Version
CheckResponse ...
func Check ¶
func Check(request CheckRequest, manager Github) (CheckResponse, error)
Check (business logic)
func (CheckResponse) Len ¶
func (r CheckResponse) Len() int
func (CheckResponse) Less ¶
func (r CheckResponse) Less(i, j int) bool
func (CheckResponse) Swap ¶
func (r CheckResponse) Swap(i, j int)
type CommitObject ¶
type CommitObject struct { ID string OID string CommittedDate githubv4.DateTime Message string Author struct { User struct { Login string } } }
CommitObject represents the GraphQL commit node. https://developer.github.com/v4/object/commit/
type GetRequest ¶
type GetRequest struct { Source Source `json:"source"` Version Version `json:"version"` Params GetParameters `json:"params"` }
GetRequest ...
type GetResponse ¶
type GetResponse struct { Version Version `json:"version"` Metadata Metadata `json:"metadata,omitempty"` }
GetResponse ...
func Get ¶
func Get(request GetRequest, github Github, git Git, outputDir string) (*GetResponse, error)
Get (business logic)
type Git ¶
type Git interface { Init() error Pull(string) error Fetch(string, int) error Checkout(string) error Merge(string) error RevParse(string) (string, error) }
Git interface for testing purposes.
type GitClient ¶
GitClient ...
func NewGitClient ¶
NewGitClient ...
type Github ¶
type Github interface { ListOpenPullRequests() ([]*PullRequest, error) ListModifiedFiles(int) ([]string, error) PostComment(string, string) error GetPullRequest(string, string) (*PullRequest, error) UpdateCommitStatus(string, string, string) error }
Github for testing purposes.
type GithubClient ¶
GithubClient for handling requests to the Github V3 and V4 APIs.
func (*GithubClient) GetPullRequest ¶ added in v0.5.0
func (m *GithubClient) GetPullRequest(prNumber, commitRef string) (*PullRequest, error)
GetPullRequest ...
func (*GithubClient) ListModifiedFiles ¶
func (m *GithubClient) ListModifiedFiles(prNumber int) ([]string, error)
ListModifiedFiles in a pull request (not supported by V4 API).
func (*GithubClient) ListOpenPullRequests ¶
func (m *GithubClient) ListOpenPullRequests() ([]*PullRequest, error)
ListOpenPullRequests gets the last commit on all open pull requests.
func (*GithubClient) PostComment ¶
func (m *GithubClient) PostComment(prNumber, comment string) error
PostComment to a pull request or issue.
func (*GithubClient) UpdateCommitStatus ¶
func (m *GithubClient) UpdateCommitStatus(commitRef, statusContext, status string) error
UpdateCommitStatus for a given commit (not supported by V4 API).
type MetadataField ¶
MetadataField ...
type PullRequest ¶
type PullRequest struct { PullRequestObject Tip CommitObject }
PullRequest represents a pull request and includes the tip (commit).
type PullRequestObject ¶
type PullRequestObject struct { ID string Number int Title string URL string BaseRefName string HeadRefName string Repository struct { URL string } }
PullRequestObject represents the GraphQL commit node. https://developer.github.com/v4/object/commit/
type PutParameters ¶
type PutParameters struct { Path string `json:"path"` Context string `json:"context"` Status string `json:"status"` CommentFile string `json:"comment_file"` Comment string `json:"comment"` }
PutParameters for the resource.
func (*PutParameters) Validate ¶
func (p *PutParameters) Validate() error
Validate the put parameters.
type PutRequest ¶
type PutRequest struct { Source Source `json:"source"` Params PutParameters `json:"params"` }
PutRequest ...
type PutResponse ¶
type PutResponse struct { Version Version `json:"version"` Metadata Metadata `json:"metadata,omitempty"` }
PutResponse ...
func Put ¶
func Put(request PutRequest, manager Github, inputDir string) (*PutResponse, error)
Put (business logic)
type Source ¶
type Source struct { Repository string `json:"repository"` AccessToken string `json:"access_token"` V3Endpoint string `json:"v3_endpoint"` V4Endpoint string `json:"v4_endpoint"` Paths []string `json:"path"` IgnorePaths []string `json:"ignore_path"` DisableCISkip string `json:"disable_ci_skip"` }
Source represents the configuration for the resource.