{"modulePath":"github.com/itsdalmo/github-pr-resource","version":"v0.8.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package resource\n\n## Functions\n\n```go\nfunc ContainsSkipCI(s string) bool\n```\nContainsSkipCI returns true if a string contains \\[ci skip] or \\[skip ci].\n\n```go\nfunc FilterIgnorePath(files []string, pattern string) ([]string, error)\n```\nFilterIgnorePath ...\n\n```go\nfunc FilterPath(files []string, pattern string) ([]string, error)\n```\nFilterPath ...\n\n## Types\n\n```go\ntype CheckRequest struct {\n\tSource  Source  `json:\"source\"`\n\tVersion Version `json:\"version\"`\n}\n```\nCheckRequest ...\n\n```go\ntype CheckResponse []Version\n```\nCheckResponse ...\n\n```go\nfunc Check(request CheckRequest, manager Github) (CheckResponse, error)\n```\nCheck (business logic)\n\n```go\nfunc (r CheckResponse) Len() int\n```\n\n```go\nfunc (r CheckResponse) Less(i, j int) bool\n```\n\n```go\nfunc (r CheckResponse) Swap(i, j int)\n```\n\n```go\ntype CommitObject struct {\n\tID            string\n\tOID           string\n\tCommittedDate githubv4.DateTime\n\tMessage       string\n\tAuthor        struct {\n\t\tUser struct {\n\t\t\tLogin string\n\t\t}\n\t}\n}\n```\nCommitObject represents the GraphQL commit node. [https://developer.github.com/v4/object/commit/](https://developer.github.com/v4/object/commit/)\n\n```go\ntype GetParameters struct {\n\tSkipDownload bool `json:\"skip_download\"`\n}\n```\nGetParameters ...\n\n```go\ntype GetRequest struct {\n\tSource  Source        `json:\"source\"`\n\tVersion Version       `json:\"version\"`\n\tParams  GetParameters `json:\"params\"`\n}\n```\nGetRequest ...\n\n```go\ntype GetResponse struct {\n\tVersion  Version  `json:\"version\"`\n\tMetadata Metadata `json:\"metadata,omitempty\"`\n}\n```\nGetResponse ...\n\n```go\nfunc Get(request GetRequest, github Github, git Git, outputDir string) (*GetResponse, error)\n```\nGet (business logic)\n\n```go\ntype Git interface {\n\tInit(string) error\n\tPull(string, string) error\n\tRevParse(string) (string, error)\n\tFetch(string, int) error\n\tMerge(string) error\n}\n```\nGit interface for testing purposes.\n\n```go\ntype GitClient struct {\n\tAccessToken string\n\tDirectory   string\n\tOutput      io.Writer\n}\n```\nGitClient ...\n\n```go\nfunc NewGitClient(source *Source, dir string, output io.Writer) (*GitClient, error)\n```\nNewGitClient ...\n\n```go\nfunc (g *GitClient) Endpoint(uri string) (string, error)\n```\nEndpoint takes an uri and produces an endpoint with the login information baked in.\n\n```go\nfunc (g *GitClient) Fetch(uri string, prNumber int) error\n```\nFetch ...\n\n```go\nfunc (g *GitClient) Init(branch string) error\n```\nInit ...\n\n```go\nfunc (g *GitClient) Merge(sha string) error\n```\nMerge ...\n\n```go\nfunc (g *GitClient) Pull(uri, branch string) error\n```\nPull ...\n\n```go\nfunc (g *GitClient) RevParse(branch string) (string, error)\n```\nRevParse retrieves the SHA of the given branch.\n\n```go\ntype Github interface {\n\tListOpenPullRequests() ([]*PullRequest, error)\n\tListModifiedFiles(int) ([]string, error)\n\tPostComment(string, string) error\n\tGetPullRequest(string, string) (*PullRequest, error)\n\tUpdateCommitStatus(string, string, string) error\n}\n```\nGithub for testing purposes.\n\n```go\ntype GithubClient struct {\n\tV3         *github.Client\n\tV4         *githubv4.Client\n\tRepository string\n\tOwner      string\n}\n```\nGithubClient for handling requests to the Github V3 and V4 APIs.\n\n```go\nfunc NewGithubClient(s *Source) (*GithubClient, error)\n```\nNewGithubClient ...\n\n```go\nfunc (m *GithubClient) GetPullRequest(prNumber, commitRef string) (*PullRequest, error)\n```\nGetPullRequest ...\n\n```go\nfunc (m *GithubClient) ListModifiedFiles(prNumber int) ([]string, error)\n```\nListModifiedFiles in a pull request (not supported by V4 API).\n\n```go\nfunc (m *GithubClient) ListOpenPullRequests() ([]*PullRequest, error)\n```\nListOpenPullRequests gets the last commit on all open pull requests.\n\n```go\nfunc (m *GithubClient) PostComment(prNumber, comment string) error\n```\nPostComment to a pull request or issue.\n\n```go\nfunc (m *GithubClient) UpdateCommitStatus(commitRef, statusContext, status string) error\n```\nUpdateCommitStatus for a given commit (not supported by V4 API).\n\n```go\ntype Metadata []*MetadataField\n```\nMetadata output from get/put steps.\n\n```go\nfunc (m *Metadata) Add(name, value string)\n```\nAdd a MetadataField to the Metadata.\n\n```go\ntype MetadataField struct {\n\tName  string `json:\"name\"`\n\tValue string `json:\"value\"`\n}\n```\nMetadataField ...\n\n```go\ntype PullRequest struct {\n\tPullRequestObject\n\tTip CommitObject\n}\n```\nPullRequest represents a pull request and includes the tip (commit).\n\n```go\ntype PullRequestObject struct {\n\tID          string\n\tNumber      int\n\tTitle       string\n\tURL         string\n\tBaseRefName string\n\tHeadRefName string\n\tRepository  struct {\n\t\tURL string\n\t}\n}\n```\nPullRequestObject represents the GraphQL commit node. [https://developer.github.com/v4/object/commit/](https://developer.github.com/v4/object/commit/)\n\n```go\ntype PutParameters struct {\n\tPath        string `json:\"path\"`\n\tContext     string `json:\"context\"`\n\tStatus      string `json:\"status\"`\n\tCommentFile string `json:\"comment_file\"`\n\tComment     string `json:\"comment\"`\n}\n```\nPutParameters for the resource.\n\n```go\nfunc (p *PutParameters) Validate() error\n```\nValidate the put parameters.\n\n```go\ntype PutRequest struct {\n\tSource Source        `json:\"source\"`\n\tParams PutParameters `json:\"params\"`\n}\n```\nPutRequest ...\n\n```go\ntype PutResponse struct {\n\tVersion  Version  `json:\"version\"`\n\tMetadata Metadata `json:\"metadata,omitempty\"`\n}\n```\nPutResponse ...\n\n```go\nfunc Put(request PutRequest, manager Github, inputDir string) (*PutResponse, error)\n```\nPut (business logic)\n\n```go\ntype Source struct {\n\tRepository          string   `json:\"repository\"`\n\tAccessToken         string   `json:\"access_token\"`\n\tV3Endpoint          string   `json:\"v3_endpoint\"`\n\tV4Endpoint          string   `json:\"v4_endpoint\"`\n\tPaths               []string `json:\"paths\"`\n\tIgnorePaths         []string `json:\"ignore_paths\"`\n\tDisableCISkip       bool     `json:\"disable_ci_skip\"`\n\tSkipSSLVerification bool     `json:\"skip_ssl_verification\"`\n}\n```\nSource represents the configuration for the resource.\n\n```go\nfunc (s *Source) Validate() error\n```\nValidate the source configuration.\n\n```go\ntype Version struct {\n\tPR            string    `json:\"pr\"`\n\tCommit        string    `json:\"commit\"`\n\tCommittedDate time.Time `json:\"committed,omitempty\"`\n}\n```\nVersion communicated with Concourse. ID is the Github Global ID.\n\n```go\nfunc NewVersion(p *PullRequest) Version\n```\nNewVersion constructs a new Version.\n\n","path":"github.com/itsdalmo/github-pr-resource","name":"resource","synopsis":"","isRedistributable":true}
