Documentation
¶
Overview ¶
Package bitbucketserver provides bitbucket server integration with tofutf
Index ¶
- Constants
- Variables
- func BaseHandleEvent(r *http.Request, secret string) (*vcs.EventPayload, error)
- func ValidateEvent(r *http.Request, secret string, payload []byte) error
- type BitbucketHookEvent
- func (e BitbucketHookEvent) GetActorAvatarURL() (string, error)
- func (e BitbucketHookEvent) GetActorURL() (string, error)
- func (e BitbucketHookEvent) GetActorUsername() (string, error)
- func (e BitbucketHookEvent) GetCommitSHA() (string, error)
- func (e BitbucketHookEvent) GetCommitURL() (string, error)
- func (e BitbucketHookEvent) IsBranchPushEvent() (bool, error)
- type EventFactory
- type EventHandler
- type TokenClient
- func (g *TokenClient) CreateWebhook(ctx context.Context, opts vcs.CreateWebhookOptions) (string, error)
- func (g *TokenClient) DeleteWebhook(ctx context.Context, opts vcs.DeleteWebhookOptions) error
- func (g *TokenClient) GetCommit(ctx context.Context, repo, ref string) (vcs.Commit, error)
- func (g *TokenClient) GetCurrentUser(ctx context.Context) (string, error)
- func (g *TokenClient) GetRepoTarball(ctx context.Context, opts vcs.GetRepoTarballOptions) ([]byte, string, error)
- func (g *TokenClient) GetRepository(ctx context.Context, identifier string) (vcs.Repository, error)
- func (g *TokenClient) GetWebhook(ctx context.Context, opts vcs.GetWebhookOptions) (vcs.Webhook, error)
- func (g *TokenClient) ListPullRequestFiles(ctx context.Context, repo string, pull int) ([]string, error)
- func (g *TokenClient) ListRepositories(ctx context.Context, lopts vcs.ListRepositoriesOptions) ([]string, error)
- func (g *TokenClient) ListTags(ctx context.Context, opts vcs.ListTagsOptions) ([]string, error)
- func (g *TokenClient) SetStatus(ctx context.Context, opts vcs.SetStatusOptions) error
- func (g *TokenClient) UpdateWebhook(ctx context.Context, id string, opts vcs.UpdateWebhookOptions) error
Constants ¶
View Source
const SignatureHeader = "X-Hub-Signature"
SignatureHeader is the header that contains the sha256 signature of the payload content.
Variables ¶
View Source
var HandleEvent = (func(r *http.Request, secret string) (*vcs.EventPayload, error))(ApplyMiddleware(BaseHandleEvent, HandleEventWithLogging))
Functions ¶
func BaseHandleEvent ¶ added in v0.6.0
Types ¶
type BitbucketHookEvent ¶ added in v0.6.0
type BitbucketHookEvent struct {
EventKey string `json:"eventKey"`
Date string `json:"date"`
Actor struct {
Name string `json:"name"`
EmailAddress string `json:"emailAddress"`
ID int `json:"id"`
DisplayName string `json:"displayName"`
Active bool `json:"active"`
Slug string `json:"slug"`
Type string `json:"type"`
Links struct {
Self []struct {
Href string `json:"href"`
} `json:"self"`
} `json:"links"`
} `json:"actor"`
Repository struct {
Slug string `json:"slug"`
ID int `json:"id"`
Name string `json:"name"`
HierarchyID string `json:"hierarchyId"`
ScmID string `json:"scmId"`
State string `json:"state"`
StatusMessage string `json:"statusMessage"`
Forkable bool `json:"forkable"`
Project struct {
Key string `json:"key"`
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Public bool `json:"public"`
Type string `json:"type"`
Links struct {
Self []struct {
Href string `json:"href"`
} `json:"self"`
} `json:"links"`
} `json:"project"`
Public bool `json:"public"`
Links struct {
Clone []struct {
Href string `json:"href"`
Name string `json:"name"`
} `json:"clone"`
Self []struct {
Href string `json:"href"`
} `json:"self"`
} `json:"links"`
} `json:"repository"`
Changes []struct {
Ref struct {
ID string `json:"id"`
DisplayID string `json:"displayId"`
Type string `json:"type"`
} `json:"ref"`
RefID string `json:"refId"`
FromHash string `json:"fromHash"`
ToHash string `json:"toHash"`
Type string `json:"type"`
} `json:"changes"`
}
func (BitbucketHookEvent) GetActorAvatarURL ¶ added in v0.6.0
func (e BitbucketHookEvent) GetActorAvatarURL() (string, error)
func (BitbucketHookEvent) GetActorURL ¶ added in v0.6.0
func (e BitbucketHookEvent) GetActorURL() (string, error)
func (BitbucketHookEvent) GetActorUsername ¶ added in v0.6.0
func (e BitbucketHookEvent) GetActorUsername() (string, error)
func (BitbucketHookEvent) GetCommitSHA ¶ added in v0.6.0
func (e BitbucketHookEvent) GetCommitSHA() (string, error)
func (BitbucketHookEvent) GetCommitURL ¶ added in v0.6.0
func (e BitbucketHookEvent) GetCommitURL() (string, error)
func (BitbucketHookEvent) IsBranchPushEvent ¶ added in v0.6.0
func (e BitbucketHookEvent) IsBranchPushEvent() (bool, error)
type EventFactory ¶ added in v0.6.0
type EventFactory func(next EventHandler) EventHandler
type EventHandler ¶ added in v0.6.0
func ApplyMiddleware ¶ added in v0.6.0
func ApplyMiddleware(base EventHandler, factories ...EventFactory) EventHandler
ApplyMiddleware applies middleware to the base EventHandler.
func HandleEventWithLogging ¶ added in v0.6.0
func HandleEventWithLogging(next EventHandler) EventHandler
type TokenClient ¶
type TokenClient struct {
// contains filtered or unexported fields
}
func NewTokenClient ¶
func NewTokenClient(opts vcs.NewTokenClientOptions) (*TokenClient, error)
func (*TokenClient) CreateWebhook ¶
func (g *TokenClient) CreateWebhook(ctx context.Context, opts vcs.CreateWebhookOptions) (string, error)
func (*TokenClient) DeleteWebhook ¶
func (g *TokenClient) DeleteWebhook(ctx context.Context, opts vcs.DeleteWebhookOptions) error
func (*TokenClient) GetCurrentUser ¶
func (g *TokenClient) GetCurrentUser(ctx context.Context) (string, error)
func (*TokenClient) GetRepoTarball ¶
func (g *TokenClient) GetRepoTarball(ctx context.Context, opts vcs.GetRepoTarballOptions) ([]byte, string, error)
func (*TokenClient) GetRepository ¶
func (g *TokenClient) GetRepository(ctx context.Context, identifier string) (vcs.Repository, error)
func (*TokenClient) GetWebhook ¶
func (g *TokenClient) GetWebhook(ctx context.Context, opts vcs.GetWebhookOptions) (vcs.Webhook, error)
func (*TokenClient) ListPullRequestFiles ¶
func (*TokenClient) ListRepositories ¶
func (g *TokenClient) ListRepositories(ctx context.Context, lopts vcs.ListRepositoriesOptions) ([]string, error)
func (*TokenClient) ListTags ¶
func (g *TokenClient) ListTags(ctx context.Context, opts vcs.ListTagsOptions) ([]string, error)
func (*TokenClient) SetStatus ¶
func (g *TokenClient) SetStatus(ctx context.Context, opts vcs.SetStatusOptions) error
func (*TokenClient) UpdateWebhook ¶
func (g *TokenClient) UpdateWebhook(ctx context.Context, id string, opts vcs.UpdateWebhookOptions) error
Click to show internal directories.
Click to hide internal directories.