webhook_creator

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

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) GetHooks added in v1.7.0

func (wc *WebhookCreatorImpl) GetHooks() *map[int64]*git_provider.HookWithStatus

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