plugin

package
v0.0.0-...-cd2c8f4 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongContentType = errors.New("Content-Type header is not set to 'application/json'")
	ErrReadingBody      = errors.New("couldn't read request body")
	ErrMarshallingBody  = errors.New("couldn't unmarshal request body")
)

Functions

func GitHubPlugin

func GitHubPlugin(plugin Executor) func(w http.ResponseWriter, req *http.Request)

Types

type ActionSpec

type ActionSpec struct {
	Issue   *IssueActionSpec `json:"issue,omitempty"`
	Timeout string           `json:"timeout,omitempty"`
}

type Executor

type Executor interface {
	Authorize(req *http.Request) error
	// Execute runs commands based on the args provided from the workflow
	Execute(args executor.ExecuteTemplateArgs) executor.ExecuteTemplateReply
}

Executor performs the tasks requested by the Workflow.

type GitHubClient

type GitHubClient struct {
	Issues GitHubIssuesClient
}

type GitHubExecutor

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

func NewGitHubExecutor

func NewGitHubExecutor(client *GitHubClient, agentToken string) GitHubExecutor

func (*GitHubExecutor) Authorize

func (e *GitHubExecutor) Authorize(req *http.Request) error

func (*GitHubExecutor) Execute

type GitHubIssuesClient

type GitHubIssuesClient interface {
	CreateComment(ctx context.Context, owner, repo string, number int, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)
	Create(ctx context.Context, owner, repo string, issue *github.IssueRequest) (*github.Issue, *github.Response, error)
}

type IssueActionSpec

type IssueActionSpec struct {
	Comment *IssueCommentAction `json:"comment,omitempty"`
	Create  *IssueCreateAction  `json:"create,omitempty"`
}

type IssueCommentAction

type IssueCommentAction struct {
	Body   string `json:"body,omitempty"`
	Owner  string `json:"owner,omitempty"`
	Repo   string `json:"repo,omitempty"`
	Number string `json:"number,omitempty"`
}

type IssueCreateAction

type IssueCreateAction struct {
	Owner   string               `json:"owner,omitempty"`
	Repo    string               `json:"repo,omitempty"`
	Request *github.IssueRequest `json:"-"`
}

type PluginSpec

type PluginSpec struct {
	GitHub *ActionSpec `json:"github,omitempty"`
}

PluginSpec represents the `plugin` block of an Argo Workflows template.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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