github

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: 25 Imported by: 0

Documentation

Overview

Package github 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")
)

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(service Service, config *api.APIConfig, githubapiClient githubapi.Client) Handler

func (*Handler) Handle

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

func (*Handler) Redirect added in v1.0.6

func (h *Handler) Redirect(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) CreateJobForGithubPush

func (m *MockService) CreateJobForGithubPush(ctx context.Context, event githubapi.PushEvent) error

CreateJobForGithubPush 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) HasValidSignature

func (m *MockService) HasValidSignature(ctx context.Context, body []byte, appIDHeader, signatureHeader string) (bool, error)

HasValidSignature mocks base method.

func (*MockService) IsAllowedInstallation

func (m *MockService) IsAllowedInstallation(ctx context.Context, installationID int) (bool, []*contracts.Organization)

IsAllowedInstallation mocks base method.

func (*MockService) PublishGithubEvent

func (m *MockService) PublishGithubEvent(ctx context.Context, event manifest.EstafetteGithubEvent) error

PublishGithubEvent 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) CreateJobForGithubPush

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

CreateJobForGithubPush indicates an expected call of CreateJobForGithubPush.

func (*MockServiceMockRecorder) HasValidSignature

func (mr *MockServiceMockRecorder) HasValidSignature(ctx, body, appIDHeader, signatureHeader interface{}) *gomock.Call

HasValidSignature indicates an expected call of HasValidSignature.

func (*MockServiceMockRecorder) IsAllowedInstallation

func (mr *MockServiceMockRecorder) IsAllowedInstallation(ctx, installationID interface{}) *gomock.Call

IsAllowedInstallation indicates an expected call of IsAllowedInstallation.

func (*MockServiceMockRecorder) PublishGithubEvent

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

PublishGithubEvent indicates an expected call of PublishGithubEvent.

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 {
	CreateJobForGithubPush(ctx context.Context, event githubapi.PushEvent) (err error)
	PublishGithubEvent(ctx context.Context, event manifest.EstafetteGithubEvent) (err error)
	HasValidSignature(ctx context.Context, body []byte, appIDHeader, signatureHeader string) (validSignature bool, 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)
	IsAllowedInstallation(ctx context.Context, installationID int) (isAllowed bool, organizations []*contracts.Organization)
}

Service handles http events for Github 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, githubapiClient githubapi.Client, pubsubapiClient pubsubapi.Client, estafetteService estafette.Service, queueService queue.Service) Service

NewService returns a github.Service to handle incoming webhook events

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