bitbucket

package
v1.0.2003 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package bitbucket is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNonCloneableEvent = errors.New("The event is not cloneable")
	ErrNoManifest        = errors.New("The repository has no manifest at the pushed commit")
	ErrOwnerIsEmpty      = errors.New("The owner slug is empty")
)

Functions

This section is empty.

Types

type Descriptor added in v1.0.1

type Descriptor struct {
	Key            string                    `json:"key,omitempty"`
	Name           string                    `json:"name,omitempty"`
	Description    string                    `json:"description,omitempty"`
	Vendor         DescriptorVendor          `json:"vendor,omitempty"`
	BaseURL        string                    `json:"baseUrl,omitempty"`
	Authentication *DescriptorAuthentication `json:"authentication,omitempty"`
	Lifecycle      *DescriptorLifecycle      `json:"lifecycle,omitempty"`
	Scopes         []string                  `json:"scopes,omitempty"`
	Contexts       []string                  `json:"contexts,omitempty"`
	Modules        *DescriptorModules        `json:"modules,omitempty"`
}

type DescriptorAuthentication added in v1.0.1

type DescriptorAuthentication struct {
	Type string `json:"type,omitempty"`
}

type DescriptorLifecycle added in v1.0.1

type DescriptorLifecycle struct {
	Installed   string `json:"installed,omitempty"`
	Uninstalled string `json:"uninstalled,omitempty"`
}

type DescriptorModules added in v1.0.1

type DescriptorModules struct {
	Webhooks []DescriptorWebhook `json:"webhooks,omitempty"`
}

type DescriptorVendor added in v1.0.1

type DescriptorVendor struct {
	Name string `json:"name,omitempty"`
	URL  string `json:"url,omitempty"`
}

type DescriptorWebhook added in v1.0.1

type DescriptorWebhook struct {
	Event string `json:"event,omitempty"`
	URL   string `json:"url,omitempty"`
}

type Handler

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

func NewHandler

func NewHandler(service Service, config *api.APIConfig, bitbucketapiClient bitbucketapi.Client) Handler

func (*Handler) Descriptor added in v1.0.1

func (h *Handler) Descriptor(c *gin.Context)

func (*Handler) Handle

func (h *Handler) Handle(c *gin.Context)

func (*Handler) Installed added in v1.0.1

func (h *Handler) Installed(c *gin.Context)

func (*Handler) Redirect added in v1.0.5

func (h *Handler) Redirect(c *gin.Context)

func (*Handler) Uninstalled added in v1.0.1

func (h *Handler) Uninstalled(c *gin.Context)

type MockService

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

MockService is a mock of Service interface

func NewMockService

func NewMockService(ctrl *gomock.Controller) *MockService

NewMockService creates a new mock instance

func (*MockService) Archive

func (m *MockService) Archive(ctx context.Context, repoSource, repoOwner, repoName string) error

Archive mocks base method

func (*MockService) CreateJobForBitbucketPush

func (m *MockService) CreateJobForBitbucketPush(ctx context.Context, installation bitbucketapi.BitbucketAppInstallation, event bitbucketapi.RepositoryPushEvent) error

CreateJobForBitbucketPush mocks base method

func (*MockService) EXPECT

func (m *MockService) EXPECT() *MockServiceMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockService) IsAllowedOwner

func (m *MockService) IsAllowedOwner(ctx context.Context, repository *bitbucketapi.Repository) (bool, []*contracts.Organization)

IsAllowedOwner mocks base method

func (*MockService) PublishBitbucketEvent

func (m *MockService) PublishBitbucketEvent(ctx context.Context, event manifest.EstafetteBitbucketEvent) error

PublishBitbucketEvent mocks base method

func (*MockService) Rename

func (m *MockService) Rename(ctx context.Context, fromRepoSource, fromRepoOwner, fromRepoName, toRepoSource, toRepoOwner, toRepoName string) error

Rename mocks base method

func (*MockService) Unarchive

func (m *MockService) Unarchive(ctx context.Context, repoSource, repoOwner, repoName string) error

Unarchive mocks base method

type MockServiceMockRecorder

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

MockServiceMockRecorder is the mock recorder for MockService

func (*MockServiceMockRecorder) Archive

func (mr *MockServiceMockRecorder) Archive(ctx, repoSource, repoOwner, repoName interface{}) *gomock.Call

Archive indicates an expected call of Archive

func (*MockServiceMockRecorder) CreateJobForBitbucketPush

func (mr *MockServiceMockRecorder) CreateJobForBitbucketPush(ctx, installation, event interface{}) *gomock.Call

CreateJobForBitbucketPush indicates an expected call of CreateJobForBitbucketPush

func (*MockServiceMockRecorder) IsAllowedOwner

func (mr *MockServiceMockRecorder) IsAllowedOwner(ctx, repository interface{}) *gomock.Call

IsAllowedOwner indicates an expected call of IsAllowedOwner

func (*MockServiceMockRecorder) PublishBitbucketEvent

func (mr *MockServiceMockRecorder) PublishBitbucketEvent(ctx, event interface{}) *gomock.Call

PublishBitbucketEvent indicates an expected call of PublishBitbucketEvent

func (*MockServiceMockRecorder) Rename

func (mr *MockServiceMockRecorder) Rename(ctx, fromRepoSource, fromRepoOwner, fromRepoName, toRepoSource, toRepoOwner, toRepoName interface{}) *gomock.Call

Rename indicates an expected call of Rename

func (*MockServiceMockRecorder) Unarchive

func (mr *MockServiceMockRecorder) Unarchive(ctx, repoSource, repoOwner, repoName interface{}) *gomock.Call

Unarchive indicates an expected call of Unarchive

type Service

type Service interface {
	CreateJobForBitbucketPush(ctx context.Context, installation bitbucketapi.BitbucketAppInstallation, event bitbucketapi.RepositoryPushEvent) (err error)
	PublishBitbucketEvent(ctx context.Context, event manifest.EstafetteBitbucketEvent) (err error)
	Rename(ctx context.Context, fromRepoSource, fromRepoOwner, fromRepoName, toRepoSource, toRepoOwner, toRepoName string) (err error)
	Archive(ctx context.Context, repoSource, repoOwner, repoName string) (err error)
	Unarchive(ctx context.Context, repoSource, repoOwner, repoName string) (err error)
	IsAllowedOwner(ctx context.Context, repository *bitbucketapi.Repository) (isAllowed bool, organizations []*contracts.Organization)
}

Service handles http events for Bitbucket integration

func NewLoggingService

func NewLoggingService(s Service) Service

NewLoggingService returns a new instance of a logging Service.

func NewMetricsService

func NewMetricsService(s Service, requestCount metrics.Counter, requestLatency metrics.Histogram) Service

NewMetricsService returns a new instance of a metrics Service.

func NewService

func NewService(config *api.APIConfig, bitbucketapiClient bitbucketapi.Client, pubsubapiClient pubsubapi.Client, estafetteService estafette.Service, queueService queue.Service) Service

NewService returns a new bitbucket.Service

func NewTracingService

func NewTracingService(s Service) Service

NewTracingService returns a new instance of a tracing Service.

Jump to

Keyboard shortcuts

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