Documentation ¶
Index ¶
- func GetBitbucketTokenScopes(client *bitbucket.Client, cfg *conf.GlobalConfig) ([]string, error)
- func GetScopes(ctx context.Context, client *github.Client) ([]string, error)
- func ValidateBitbucketPermissions(client *bitbucket.Client, cfg *conf.GlobalConfig) error
- func ValidatePermissions(ctx context.Context, client *github.Client, cfg *conf.GlobalConfig) error
- type BitbucketClientImpl
- func (b BitbucketClientImpl) GetFile(ctx *context.Context, repo string, branch string, path string) (*CommitFile, error)
- func (b BitbucketClientImpl) GetFiles(ctx *context.Context, repo string, branch string, paths []string) ([]*CommitFile, error)
- func (b BitbucketClientImpl) HandlePayload(ctx *context.Context, request *http.Request, secret []byte) (*WebhookPayload, error)
- func (b BitbucketClientImpl) ListFiles(ctx *context.Context, repo string, branch string, path string) ([]string, error)
- func (b BitbucketClientImpl) PingHook(ctx *context.Context, hook *HookWithStatus) error
- func (b BitbucketClientImpl) SetStatus(ctx *context.Context, repo *string, commit *string, linkURL *string, ...) error
- func (b BitbucketClientImpl) SetWebhook(ctx *context.Context, repo *string) (*HookWithStatus, error)
- func (b BitbucketClientImpl) UnsetWebhook(ctx *context.Context, hook *HookWithStatus) error
- type Client
- type CommitFile
- type GithubClientImpl
- func (c *GithubClientImpl) GetFile(ctx *context.Context, repo string, branch string, path string) (*CommitFile, error)
- func (c *GithubClientImpl) GetFiles(ctx *context.Context, repo string, branch string, paths []string) ([]*CommitFile, error)
- func (c *GithubClientImpl) HandlePayload(ctx *context.Context, request *http.Request, secret []byte) (*WebhookPayload, error)
- func (c *GithubClientImpl) ListFiles(ctx *context.Context, repo string, branch string, path string) ([]string, error)
- func (c *GithubClientImpl) PingHook(ctx *context.Context, hook *HookWithStatus) error
- func (c *GithubClientImpl) SetStatus(ctx *context.Context, repo *string, commit *string, linkURL *string, ...) error
- func (c *GithubClientImpl) SetWebhook(ctx *context.Context, repo *string) (*HookWithStatus, error)
- func (c *GithubClientImpl) UnsetWebhook(ctx *context.Context, hook *HookWithStatus) error
- type HookWithStatus
- type WebhookPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBitbucketTokenScopes ¶ added in v1.5.0
func ValidateBitbucketPermissions ¶ added in v1.5.0
func ValidateBitbucketPermissions(client *bitbucket.Client, cfg *conf.GlobalConfig) error
func ValidatePermissions ¶
Types ¶
type BitbucketClientImpl ¶ added in v1.5.0
type BitbucketClientImpl struct { HooksHashTable map[string]int64 // contains filtered or unexported fields }
func (BitbucketClientImpl) GetFile ¶ added in v1.5.0
func (b BitbucketClientImpl) GetFile(ctx *context.Context, repo string, branch string, path string) (*CommitFile, error)
func (BitbucketClientImpl) GetFiles ¶ added in v1.5.0
func (b BitbucketClientImpl) GetFiles(ctx *context.Context, repo string, branch string, paths []string) ([]*CommitFile, error)
func (BitbucketClientImpl) HandlePayload ¶ added in v1.5.0
func (b BitbucketClientImpl) HandlePayload(ctx *context.Context, request *http.Request, secret []byte) (*WebhookPayload, error)
func (BitbucketClientImpl) PingHook ¶ added in v1.5.0
func (b BitbucketClientImpl) PingHook(ctx *context.Context, hook *HookWithStatus) error
func (BitbucketClientImpl) SetWebhook ¶ added in v1.5.0
func (b BitbucketClientImpl) SetWebhook(ctx *context.Context, repo *string) (*HookWithStatus, error)
func (BitbucketClientImpl) UnsetWebhook ¶ added in v1.5.0
func (b BitbucketClientImpl) UnsetWebhook(ctx *context.Context, hook *HookWithStatus) error
type Client ¶
type Client interface { ListFiles(ctx *context.Context, repo string, branch string, path string) ([]string, error) GetFile(ctx *context.Context, repo string, branch string, path string) (*CommitFile, error) GetFiles(ctx *context.Context, repo string, branch string, paths []string) ([]*CommitFile, error) SetWebhook(ctx *context.Context, repo *string) (*HookWithStatus, error) UnsetWebhook(ctx *context.Context, hook *HookWithStatus) error HandlePayload(ctx *context.Context, request *http.Request, secret []byte) (*WebhookPayload, error) SetStatus(ctx *context.Context, repo *string, commit *string, linkURL *string, status *string, message *string) error PingHook(ctx *context.Context, hook *HookWithStatus) error }
func NewBitbucketServerClient ¶ added in v1.5.0
func NewBitbucketServerClient(cfg *conf.GlobalConfig) (Client, error)
func NewGitProviderClient ¶
func NewGitProviderClient(cfg *conf.GlobalConfig) (Client, error)
func NewGithubClient ¶
func NewGithubClient(cfg *conf.GlobalConfig) (Client, error)
type CommitFile ¶
type GithubClientImpl ¶
type GithubClientImpl struct {
// contains filtered or unexported fields
}
func (*GithubClientImpl) GetFile ¶
func (c *GithubClientImpl) GetFile(ctx *context.Context, repo string, branch string, path string) (*CommitFile, error)
func (*GithubClientImpl) GetFiles ¶
func (c *GithubClientImpl) GetFiles(ctx *context.Context, repo string, branch string, paths []string) ([]*CommitFile, error)
func (*GithubClientImpl) HandlePayload ¶
func (c *GithubClientImpl) HandlePayload(ctx *context.Context, request *http.Request, secret []byte) (*WebhookPayload, error)
func (*GithubClientImpl) PingHook ¶ added in v1.4.0
func (c *GithubClientImpl) PingHook(ctx *context.Context, hook *HookWithStatus) error
func (*GithubClientImpl) SetWebhook ¶
func (c *GithubClientImpl) SetWebhook(ctx *context.Context, repo *string) (*HookWithStatus, error)
func (*GithubClientImpl) UnsetWebhook ¶
func (c *GithubClientImpl) UnsetWebhook(ctx *context.Context, hook *HookWithStatus) error
type HookWithStatus ¶ added in v1.4.0
type WebhookPayload ¶
type WebhookPayload struct { Event string `json:"event"` Action string `json:"action"` Repo string `json:"repoName"` Branch string `json:"branch"` Commit string `json:"commit"` User string `json:"user"` UserEmail string `json:"user_email"` PullRequestURL string `json:"pull_request_url"` PullRequestTitle string `json:"pull_request_title"` DestBranch string `json:"dest_branch"` Labels []string `json:"labels"` HookID int64 `json:"hookID"` OwnerID int64 `json:"ownerID"` }
Click to show internal directories.
Click to hide internal directories.