{"modulePath":"github.com/crenshaw-dev/github-executor-plugin","version":"v0.0.0-20221210233556-cd2c8f484e4c","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package plugin\n\n## Variables\n\n```go\nvar (\n\tErrWrongContentType = errors.New(\"Content-Type header is not set to 'application/json'\")\n\tErrReadingBody      = errors.New(\"couldn't read request body\")\n\tErrMarshallingBody  = errors.New(\"couldn't unmarshal request body\")\n)\n```\n\n## Functions\n\n```go\nfunc GitHubPlugin(plugin Executor) func(w http.ResponseWriter, req *http.Request)\n```\n\n## Types\n\n```go\ntype ActionSpec struct {\n\tIssue   *IssueActionSpec `json:\"issue,omitempty\"`\n\tTimeout string           `json:\"timeout,omitempty\"`\n}\n```\n\n```go\ntype Executor interface {\n\tAuthorize(req *http.Request) error\n\t// Execute runs commands based on the args provided from the workflow\n\tExecute(args executor.ExecuteTemplateArgs) executor.ExecuteTemplateReply\n}\n```\nExecutor performs the tasks requested by the Workflow.\n\n```go\ntype GitHubClient struct {\n\tIssues GitHubIssuesClient\n}\n```\n\n```go\ntype GitHubExecutor struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewGitHubExecutor(client *GitHubClient, agentToken string) GitHubExecutor\n```\n\n```go\nfunc (e *GitHubExecutor) Authorize(req *http.Request) error\n```\n\n```go\nfunc (e *GitHubExecutor) Execute(args executor.ExecuteTemplateArgs) executor.ExecuteTemplateReply\n```\n\n```go\ntype GitHubIssuesClient interface {\n\tCreateComment(ctx context.Context, owner, repo string, number int, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)\n\tCreate(ctx context.Context, owner, repo string, issue *github.IssueRequest) (*github.Issue, *github.Response, error)\n}\n```\n\n```go\ntype IssueActionSpec struct {\n\tComment *IssueCommentAction `json:\"comment,omitempty\"`\n\tCreate  *IssueCreateAction  `json:\"create,omitempty\"`\n}\n```\n\n```go\ntype IssueCommentAction struct {\n\tBody   string `json:\"body,omitempty\"`\n\tOwner  string `json:\"owner,omitempty\"`\n\tRepo   string `json:\"repo,omitempty\"`\n\tNumber string `json:\"number,omitempty\"`\n}\n```\n\n```go\ntype IssueCreateAction struct {\n\tOwner   string               `json:\"owner,omitempty\"`\n\tRepo    string               `json:\"repo,omitempty\"`\n\tRequest *github.IssueRequest `json:\"-\"`\n}\n```\n\n```go\ntype PluginSpec struct {\n\tGitHub *ActionSpec `json:\"github,omitempty\"`\n}\n```\nPluginSpec represents the \\`plugin\\` block of an Argo Workflows template.\n\n","path":"github.com/crenshaw-dev/github-executor-plugin/internal","name":"plugin","synopsis":"","isRedistributable":true}
