Documentation
¶
Overview ¶
templ: version: v0.3.943
Index ¶
- Variables
- func HandleEvent(r *http.Request, secret string) (*vcs.EventPayload, error)
- func Icon() templ.Component
- func NewTokenClient(opts vcs.NewTokenClientOptions) (vcs.Client, error)
- func RegisterVCSKind(vcsService *vcs.Service, defaultURL *internal.WebURL, skipTLSVerification bool)
- func SendEventRequest(t *testing.T, event string, url, secret string, payload []byte)
- type Client
- func (c *Client) CreateWebhook(ctx context.Context, opts vcs.CreateWebhookOptions) (string, error)
- func (c *Client) DeleteWebhook(ctx context.Context, opts vcs.DeleteWebhookOptions) error
- func (c *Client) GetCommit(ctx context.Context, repo vcs.Repo, refname string) (vcs.Commit, error)
- func (c *Client) GetDefaultBranch(ctx context.Context, identifier string) (string, error)
- func (c *Client) GetRepoTarball(ctx context.Context, opts vcs.GetRepoTarballOptions) ([]byte, string, error)
- func (c *Client) GetWebhook(ctx context.Context, opts vcs.GetWebhookOptions) (vcs.Webhook, error)
- func (c *Client) ListPullRequestFiles(ctx context.Context, repo vcs.Repo, pull int) ([]string, error)
- func (c *Client) ListRepositories(ctx context.Context, opts vcs.ListRepositoriesOptions) ([]vcs.Repo, error)
- func (c *Client) ListTags(ctx context.Context, opts vcs.ListTagsOptions) ([]string, error)
- func (c *Client) SetStatus(ctx context.Context, opts vcs.SetStatusOptions) error
- func (c *Client) UpdateWebhook(ctx context.Context, id string, opts vcs.UpdateWebhookOptions) error
- type GithubEvent
- type PullRequestEvent
- type PushEvent
- type TestServer
- type TestServerOption
- func WithArchive(tarball []byte) TestServerOption
- func WithCommit(commit string) TestServerOption
- func WithDefaultBranch(branch string) TestServerOption
- func WithDisableTLS() TestServerOption
- func WithHandler(path string, h http.HandlerFunc) TestServerOption
- func WithHook(hook hook) TestServerOption
- func WithPullRequest(pullNumber string, changedPaths ...string) TestServerOption
- func WithRefs(refs ...testref) TestServerOption
- func WithRepo(repo vcs.Repo) TestServerOption
- func WithUsername(username user.Username) TestServerOption
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultBaseURL = internal.MustWebURL("https://next.forgejo.org")
Functions ¶
func HandleEvent ¶
func NewTokenClient ¶
func NewTokenClient(opts vcs.NewTokenClientOptions) (vcs.Client, error)
func RegisterVCSKind ¶ added in v0.3.24
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateWebhook ¶
func (*Client) DeleteWebhook ¶
func (*Client) GetDefaultBranch ¶ added in v0.3.24
func (*Client) GetRepoTarball ¶
func (*Client) GetWebhook ¶
func (*Client) ListPullRequestFiles ¶
func (c *Client) ListPullRequestFiles(ctx context.Context, repo vcs.Repo, pull int) ([]string, error)
ListPullRequestFiles returns the paths of files that are modified in the pull request
func (*Client) ListRepositories ¶
func (*Client) UpdateWebhook ¶
type PullRequestEvent ¶
type PullRequestEvent struct {
Action string `json:"action"`
CommitID string `json:"commit_id"`
Number int64 `json:"number"`
PullRequest forgejo.PullRequest `json:"pull_request"`
Repository forgejo.Repository `json:"repository"`
Sender forgejo.User `json:"sender"`
}
type PushEvent ¶
type PushEvent struct {
Ref string `json:"ref"`
Before string `json:"before"`
After string `json:"after"`
CompareURL string `json:"compare_url"`
HeadCommit *forgejo.Commit `json:"head_commit"`
Commits []forgejo.Commit `json:"commits"`
Repository forgejo.Repository `json:"repository"`
Pusher forgejo.User `json:"pusher"`
Sender forgejo.User `json:"sender"`
}
type TestServer ¶
type TestServer struct {
// webhook created/updated/deleted events channel
WebhookEvents chan webhookEvent
*httptest.Server
// contains filtered or unexported fields
}
func NewTestServer ¶
func NewTestServer(t *testing.T, opts ...TestServerOption) (*TestServer, *url.URL)
func (*TestServer) GetStatus ¶
GetStatus retrieves a commit status event off the queue, timing out after 10 seconds if nothing is on the queue.
func (*TestServer) HasWebhook ¶
func (s *TestServer) HasWebhook() bool
type TestServerOption ¶
type TestServerOption func(*TestServer)
func WithArchive ¶
func WithArchive(tarball []byte) TestServerOption
func WithCommit ¶
func WithCommit(commit string) TestServerOption
func WithDefaultBranch ¶
func WithDefaultBranch(branch string) TestServerOption
func WithDisableTLS ¶
func WithDisableTLS() TestServerOption
func WithHandler ¶
func WithHandler(path string, h http.HandlerFunc) TestServerOption
func WithHook ¶
func WithHook(hook hook) TestServerOption
func WithPullRequest ¶
func WithPullRequest(pullNumber string, changedPaths ...string) TestServerOption
func WithRefs ¶
func WithRefs(refs ...testref) TestServerOption
func WithRepo ¶
func WithRepo(repo vcs.Repo) TestServerOption
func WithUsername ¶
func WithUsername(username user.Username) TestServerOption
Click to show internal directories.
Click to hide internal directories.