webhook_creator

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockGitProviderClient

type MockGitProviderClient struct {
	ListFilesFunc     func(ctx context.Context, repo string, branch string, path string) ([]string, error)
	GetFileFunc       func(ctx context.Context, repo string, branch string, path string) (*git_provider.CommitFile, error)
	GetFilesFunc      func(ctx context.Context, repo string, branch string, paths []string) ([]*git_provider.CommitFile, error)
	SetWebhookFunc    func(ctx context.Context, repo *string) (*git_provider.HookWithStatus, error)
	UnsetWebhookFunc  func(ctx context.Context, hook *git_provider.HookWithStatus) error
	HandlePayloadFunc func(request *http.Request, secret []byte) (*git_provider.WebhookPayload, error)
	SetStatusFunc     func(ctx context.Context, repo *string, commit *string, linkURL *string, status *string, message *string) error
	PingHookFunc      func(ctx context.Context, hook *git_provider.HookWithStatus) error
}

func (*MockGitProviderClient) GetFile

func (m *MockGitProviderClient) GetFile(ctx *context.Context, repo string, branch string, path string) (*git_provider.CommitFile, error)

func (*MockGitProviderClient) GetFiles

func (m *MockGitProviderClient) GetFiles(ctx *context.Context, repo string, branch string, paths []string) ([]*git_provider.CommitFile, error)

func (*MockGitProviderClient) HandlePayload

func (m *MockGitProviderClient) HandlePayload(ctx *context.Context, request *http.Request, secret []byte) (*git_provider.WebhookPayload, error)

func (*MockGitProviderClient) ListFiles

func (m *MockGitProviderClient) ListFiles(ctx *context.Context, repo string, branch string, path string) ([]string, error)

func (*MockGitProviderClient) PingHook

func (*MockGitProviderClient) SetStatus

func (m *MockGitProviderClient) SetStatus(ctx *context.Context, repo *string, commit *string, linkURL *string, status *string, message *string) error

func (*MockGitProviderClient) SetWebhook

func (*MockGitProviderClient) UnsetWebhook

type WebhookCreator

type WebhookCreator interface {
	Stop(ctx *context.Context)
	Start()
	SetWebhookHealth(status bool, hookID *int64) error
	RunDiagnosis(ctx *context.Context) error
}

type WebhookCreatorImpl

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

func NewWebhookCreator

func NewWebhookCreator(cfg *conf.GlobalConfig, clients *clients.Clients) *WebhookCreatorImpl

func (*WebhookCreatorImpl) RunDiagnosis

func (wc *WebhookCreatorImpl) RunDiagnosis(ctx *context.Context) error

func (*WebhookCreatorImpl) SetWebhookHealth

func (wc *WebhookCreatorImpl) SetWebhookHealth(hookID int64, status bool) error

func (*WebhookCreatorImpl) Start

func (wc *WebhookCreatorImpl) Start()

func (*WebhookCreatorImpl) Stop

func (wc *WebhookCreatorImpl) Stop(ctx *context.Context)

Jump to

Keyboard shortcuts

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