github

package
v0.0.0-...-8c24642 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

The github package exists to provide a client for the GH API, which can also be faked with a mock. In most cases, we want the real client, but testing should mock it, lest we get blocked from their API, or have to configure auth for simple tests.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrResourceNotFound = errors.New("the resource does not exist")
	//lint:ignore ST1005 this is not punctuation
	ErrServiceUnavailable = apierrors.NewServiceUnavailable("github is unavailable")
	ErrTooManyItems       = errors.New("maximum number of items exceeded")
)

API errors that we need to convey after parsing real GH errors (or faking them).

Functions

func Extra

func Extra(decrypter repository.Decrypter, factory *Factory, webhookBuilder WebhookURLBuilder) repository.Extra

func Mutate

func Mutate(ctx context.Context, obj runtime.Object) error

func ParseOwnerRepoGithub

func ParseOwnerRepoGithub(giturl string) (owner string, repo string, err error)

Types

type Client

type Client interface {
	// Commits
	Commits(ctx context.Context, owner, repository, path, branch string) ([]Commit, error)

	// Webhooks
	ListWebhooks(ctx context.Context, owner, repository string) ([]WebhookConfig, error)
	CreateWebhook(ctx context.Context, owner, repository string, cfg WebhookConfig) (WebhookConfig, error)
	GetWebhook(ctx context.Context, owner, repository string, webhookID int64) (WebhookConfig, error)
	DeleteWebhook(ctx context.Context, owner, repository string, webhookID int64) error
	EditWebhook(ctx context.Context, owner, repository string, cfg WebhookConfig) error

	// Pull requests
	ListPullRequestFiles(ctx context.Context, owner, repository string, number int) ([]CommitFile, error)
	CreatePullRequestComment(ctx context.Context, owner, repository string, number int, body string) error
}

func NewClient

func NewClient(client *github.Client) Client

type Commit

type Commit struct {
	Ref       string
	Message   string
	Author    *CommitAuthor
	Committer *CommitAuthor
	CreatedAt time.Time
}

type CommitAuthor

type CommitAuthor struct {
	Name      string
	Username  string
	AvatarURL string
}

type CommitFile

type CommitFile interface {
	GetSHA() string
	GetFilename() string
	GetPreviousFilename() string
	GetStatus() string
}

type Factory

type Factory struct {
	// Client allows overriding the client to use in the GH client returned. It exists primarily for testing.
	// FIXME: we should replace in this way. We should add some options pattern for the factory.
	Client *http.Client
}

Factory creates new GitHub clients. It exists only for the ability to test the code easily.

func ProvideFactory

func ProvideFactory() *Factory

func (*Factory) New

func (r *Factory) New(ctx context.Context, ghToken common.RawSecureValue) Client

type GithubWebhookRepository

type GithubWebhookRepository interface {
	GithubRepository
	repository.Hooks

	WebhookRepository
}

func NewGithubWebhookRepository

func NewGithubWebhookRepository(
	basic GithubRepository,
	webhookURL string,
	secret common.RawSecureValue,
) GithubWebhookRepository

type MockClient

type MockClient struct {
	mock.Mock
}

MockClient is an autogenerated mock type for the Client type

func NewMockClient

func NewMockClient(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockClient

NewMockClient creates a new instance of MockClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockClient) Commits

func (_m *MockClient) Commits(ctx context.Context, owner string, repository string, path string, branch string) ([]Commit, error)

Commits provides a mock function with given fields: ctx, owner, repository, path, branch

func (*MockClient) CreatePullRequestComment

func (_m *MockClient) CreatePullRequestComment(ctx context.Context, owner string, repository string, number int, body string) error

CreatePullRequestComment provides a mock function with given fields: ctx, owner, repository, number, body

func (*MockClient) CreateWebhook

func (_m *MockClient) CreateWebhook(ctx context.Context, owner string, repository string, cfg WebhookConfig) (WebhookConfig, error)

CreateWebhook provides a mock function with given fields: ctx, owner, repository, cfg

func (*MockClient) DeleteWebhook

func (_m *MockClient) DeleteWebhook(ctx context.Context, owner string, repository string, webhookID int64) error

DeleteWebhook provides a mock function with given fields: ctx, owner, repository, webhookID

func (*MockClient) EXPECT

func (_m *MockClient) EXPECT() *MockClient_Expecter

func (*MockClient) EditWebhook

func (_m *MockClient) EditWebhook(ctx context.Context, owner string, repository string, cfg WebhookConfig) error

EditWebhook provides a mock function with given fields: ctx, owner, repository, cfg

func (*MockClient) GetWebhook

func (_m *MockClient) GetWebhook(ctx context.Context, owner string, repository string, webhookID int64) (WebhookConfig, error)

GetWebhook provides a mock function with given fields: ctx, owner, repository, webhookID

func (*MockClient) ListPullRequestFiles

func (_m *MockClient) ListPullRequestFiles(ctx context.Context, owner string, repository string, number int) ([]CommitFile, error)

ListPullRequestFiles provides a mock function with given fields: ctx, owner, repository, number

func (*MockClient) ListWebhooks

func (_m *MockClient) ListWebhooks(ctx context.Context, owner string, repository string) ([]WebhookConfig, error)

ListWebhooks provides a mock function with given fields: ctx, owner, repository

type MockClient_Commits_Call

type MockClient_Commits_Call struct {
	*mock.Call
}

MockClient_Commits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Commits'

func (*MockClient_Commits_Call) Return

func (*MockClient_Commits_Call) Run

func (_c *MockClient_Commits_Call) Run(run func(ctx context.Context, owner string, repository string, path string, branch string)) *MockClient_Commits_Call

func (*MockClient_Commits_Call) RunAndReturn

type MockClient_CreatePullRequestComment_Call

type MockClient_CreatePullRequestComment_Call struct {
	*mock.Call
}

MockClient_CreatePullRequestComment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreatePullRequestComment'

func (*MockClient_CreatePullRequestComment_Call) Return

func (*MockClient_CreatePullRequestComment_Call) Run

func (*MockClient_CreatePullRequestComment_Call) RunAndReturn

type MockClient_CreateWebhook_Call

type MockClient_CreateWebhook_Call struct {
	*mock.Call
}

MockClient_CreateWebhook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateWebhook'

func (*MockClient_CreateWebhook_Call) Return

func (*MockClient_CreateWebhook_Call) Run

func (*MockClient_CreateWebhook_Call) RunAndReturn

type MockClient_DeleteWebhook_Call

type MockClient_DeleteWebhook_Call struct {
	*mock.Call
}

MockClient_DeleteWebhook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteWebhook'

func (*MockClient_DeleteWebhook_Call) Return

func (*MockClient_DeleteWebhook_Call) Run

func (_c *MockClient_DeleteWebhook_Call) Run(run func(ctx context.Context, owner string, repository string, webhookID int64)) *MockClient_DeleteWebhook_Call

func (*MockClient_DeleteWebhook_Call) RunAndReturn

type MockClient_EditWebhook_Call

type MockClient_EditWebhook_Call struct {
	*mock.Call
}

MockClient_EditWebhook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EditWebhook'

func (*MockClient_EditWebhook_Call) Return

func (*MockClient_EditWebhook_Call) Run

func (_c *MockClient_EditWebhook_Call) Run(run func(ctx context.Context, owner string, repository string, cfg WebhookConfig)) *MockClient_EditWebhook_Call

func (*MockClient_EditWebhook_Call) RunAndReturn

type MockClient_Expecter

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

func (*MockClient_Expecter) Commits

func (_e *MockClient_Expecter) Commits(ctx interface{}, owner interface{}, repository interface{}, path interface{}, branch interface{}) *MockClient_Commits_Call

Commits is a helper method to define mock.On call

  • ctx context.Context
  • owner string
  • repository string
  • path string
  • branch string

func (*MockClient_Expecter) CreatePullRequestComment

func (_e *MockClient_Expecter) CreatePullRequestComment(ctx interface{}, owner interface{}, repository interface{}, number interface{}, body interface{}) *MockClient_CreatePullRequestComment_Call

CreatePullRequestComment is a helper method to define mock.On call

  • ctx context.Context
  • owner string
  • repository string
  • number int
  • body string

func (*MockClient_Expecter) CreateWebhook

func (_e *MockClient_Expecter) CreateWebhook(ctx interface{}, owner interface{}, repository interface{}, cfg interface{}) *MockClient_CreateWebhook_Call

CreateWebhook is a helper method to define mock.On call

  • ctx context.Context
  • owner string
  • repository string
  • cfg WebhookConfig

func (*MockClient_Expecter) DeleteWebhook

func (_e *MockClient_Expecter) DeleteWebhook(ctx interface{}, owner interface{}, repository interface{}, webhookID interface{}) *MockClient_DeleteWebhook_Call

DeleteWebhook is a helper method to define mock.On call

  • ctx context.Context
  • owner string
  • repository string
  • webhookID int64

func (*MockClient_Expecter) EditWebhook

func (_e *MockClient_Expecter) EditWebhook(ctx interface{}, owner interface{}, repository interface{}, cfg interface{}) *MockClient_EditWebhook_Call

EditWebhook is a helper method to define mock.On call

  • ctx context.Context
  • owner string
  • repository string
  • cfg WebhookConfig

func (*MockClient_Expecter) GetWebhook

func (_e *MockClient_Expecter) GetWebhook(ctx interface{}, owner interface{}, repository interface{}, webhookID interface{}) *MockClient_GetWebhook_Call

GetWebhook is a helper method to define mock.On call

  • ctx context.Context
  • owner string
  • repository string
  • webhookID int64

func (*MockClient_Expecter) ListPullRequestFiles

func (_e *MockClient_Expecter) ListPullRequestFiles(ctx interface{}, owner interface{}, repository interface{}, number interface{}) *MockClient_ListPullRequestFiles_Call

ListPullRequestFiles is a helper method to define mock.On call

  • ctx context.Context
  • owner string
  • repository string
  • number int

func (*MockClient_Expecter) ListWebhooks

func (_e *MockClient_Expecter) ListWebhooks(ctx interface{}, owner interface{}, repository interface{}) *MockClient_ListWebhooks_Call

ListWebhooks is a helper method to define mock.On call

  • ctx context.Context
  • owner string
  • repository string

type MockClient_GetWebhook_Call

type MockClient_GetWebhook_Call struct {
	*mock.Call
}

MockClient_GetWebhook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWebhook'

func (*MockClient_GetWebhook_Call) Return

func (*MockClient_GetWebhook_Call) Run

func (_c *MockClient_GetWebhook_Call) Run(run func(ctx context.Context, owner string, repository string, webhookID int64)) *MockClient_GetWebhook_Call

func (*MockClient_GetWebhook_Call) RunAndReturn

type MockClient_ListPullRequestFiles_Call

type MockClient_ListPullRequestFiles_Call struct {
	*mock.Call
}

MockClient_ListPullRequestFiles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPullRequestFiles'

func (*MockClient_ListPullRequestFiles_Call) Return

func (*MockClient_ListPullRequestFiles_Call) Run

func (*MockClient_ListPullRequestFiles_Call) RunAndReturn

type MockClient_ListWebhooks_Call

type MockClient_ListWebhooks_Call struct {
	*mock.Call
}

MockClient_ListWebhooks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListWebhooks'

func (*MockClient_ListWebhooks_Call) Return

func (*MockClient_ListWebhooks_Call) Run

func (_c *MockClient_ListWebhooks_Call) Run(run func(ctx context.Context, owner string, repository string)) *MockClient_ListWebhooks_Call

func (*MockClient_ListWebhooks_Call) RunAndReturn

type MockCommitFile

type MockCommitFile struct {
	mock.Mock
}

MockCommitFile is an autogenerated mock type for the CommitFile type

func NewMockCommitFile

func NewMockCommitFile(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockCommitFile

NewMockCommitFile creates a new instance of MockCommitFile. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockCommitFile) EXPECT

func (*MockCommitFile) GetFilename

func (_m *MockCommitFile) GetFilename() string

GetFilename provides a mock function with no fields

func (*MockCommitFile) GetPreviousFilename

func (_m *MockCommitFile) GetPreviousFilename() string

GetPreviousFilename provides a mock function with no fields

func (*MockCommitFile) GetSHA

func (_m *MockCommitFile) GetSHA() string

GetSHA provides a mock function with no fields

func (*MockCommitFile) GetStatus

func (_m *MockCommitFile) GetStatus() string

GetStatus provides a mock function with no fields

type MockCommitFile_Expecter

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

func (*MockCommitFile_Expecter) GetFilename

GetFilename is a helper method to define mock.On call

func (*MockCommitFile_Expecter) GetPreviousFilename

GetPreviousFilename is a helper method to define mock.On call

func (*MockCommitFile_Expecter) GetSHA

GetSHA is a helper method to define mock.On call

func (*MockCommitFile_Expecter) GetStatus

GetStatus is a helper method to define mock.On call

type MockCommitFile_GetFilename_Call

type MockCommitFile_GetFilename_Call struct {
	*mock.Call
}

MockCommitFile_GetFilename_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFilename'

func (*MockCommitFile_GetFilename_Call) Return

func (*MockCommitFile_GetFilename_Call) Run

func (*MockCommitFile_GetFilename_Call) RunAndReturn

type MockCommitFile_GetPreviousFilename_Call

type MockCommitFile_GetPreviousFilename_Call struct {
	*mock.Call
}

MockCommitFile_GetPreviousFilename_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPreviousFilename'

func (*MockCommitFile_GetPreviousFilename_Call) Return

func (*MockCommitFile_GetPreviousFilename_Call) Run

func (*MockCommitFile_GetPreviousFilename_Call) RunAndReturn

type MockCommitFile_GetSHA_Call

type MockCommitFile_GetSHA_Call struct {
	*mock.Call
}

MockCommitFile_GetSHA_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSHA'

func (*MockCommitFile_GetSHA_Call) Return

func (*MockCommitFile_GetSHA_Call) Run

func (*MockCommitFile_GetSHA_Call) RunAndReturn

func (_c *MockCommitFile_GetSHA_Call) RunAndReturn(run func() string) *MockCommitFile_GetSHA_Call

type MockCommitFile_GetStatus_Call

type MockCommitFile_GetStatus_Call struct {
	*mock.Call
}

MockCommitFile_GetStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStatus'

func (*MockCommitFile_GetStatus_Call) Return

func (*MockCommitFile_GetStatus_Call) Run

func (*MockCommitFile_GetStatus_Call) RunAndReturn

type MockGithubRepository

type MockGithubRepository struct {
	mock.Mock
}

MockGithubRepository is an autogenerated mock type for the GithubRepository type

func NewMockGithubRepository

func NewMockGithubRepository(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockGithubRepository

NewMockGithubRepository creates a new instance of MockGithubRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockGithubRepository) Client

func (_m *MockGithubRepository) Client() Client

Client provides a mock function with no fields

func (*MockGithubRepository) CompareFiles

func (_m *MockGithubRepository) CompareFiles(ctx context.Context, base string, ref string) ([]repository.VersionedFileChange, error)

CompareFiles provides a mock function with given fields: ctx, base, ref

func (*MockGithubRepository) Config

Config provides a mock function with no fields

func (*MockGithubRepository) Create

func (_m *MockGithubRepository) Create(ctx context.Context, path string, ref string, data []byte, message string) error

Create provides a mock function with given fields: ctx, path, ref, data, message

func (*MockGithubRepository) Delete

func (_m *MockGithubRepository) Delete(ctx context.Context, path string, ref string, message string) error

Delete provides a mock function with given fields: ctx, path, ref, message

func (*MockGithubRepository) EXPECT

func (*MockGithubRepository) History

func (_m *MockGithubRepository) History(ctx context.Context, path string, ref string) ([]v0alpha1.HistoryItem, error)

History provides a mock function with given fields: ctx, path, ref

func (*MockGithubRepository) LatestRef

func (_m *MockGithubRepository) LatestRef(ctx context.Context) (string, error)

LatestRef provides a mock function with given fields: ctx

func (*MockGithubRepository) ListRefs

func (_m *MockGithubRepository) ListRefs(ctx context.Context) ([]v0alpha1.RefItem, error)

ListRefs provides a mock function with given fields: ctx

func (*MockGithubRepository) Move

func (_m *MockGithubRepository) Move(ctx context.Context, oldPath string, newPath string, ref string, message string) error

Move provides a mock function with given fields: ctx, oldPath, newPath, ref, message

func (*MockGithubRepository) Owner

func (_m *MockGithubRepository) Owner() string

Owner provides a mock function with no fields

func (*MockGithubRepository) Read

Read provides a mock function with given fields: ctx, path, ref

func (*MockGithubRepository) ReadTree

ReadTree provides a mock function with given fields: ctx, ref

func (*MockGithubRepository) RefURLs

RefURLs provides a mock function with given fields: ctx, ref

func (*MockGithubRepository) Repo

func (_m *MockGithubRepository) Repo() string

Repo provides a mock function with no fields

func (*MockGithubRepository) ResourceURLs

ResourceURLs provides a mock function with given fields: ctx, file

func (*MockGithubRepository) Stage

Stage provides a mock function with given fields: ctx, opts

func (*MockGithubRepository) Test

Test provides a mock function with given fields: ctx

func (*MockGithubRepository) Update

func (_m *MockGithubRepository) Update(ctx context.Context, path string, ref string, data []byte, message string) error

Update provides a mock function with given fields: ctx, path, ref, data, message

func (*MockGithubRepository) Validate

func (_m *MockGithubRepository) Validate() field.ErrorList

Validate provides a mock function with no fields

func (*MockGithubRepository) Write

func (_m *MockGithubRepository) Write(ctx context.Context, path string, ref string, data []byte, message string) error

Write provides a mock function with given fields: ctx, path, ref, data, message

type MockGithubRepository_Client_Call

type MockGithubRepository_Client_Call struct {
	*mock.Call
}

MockGithubRepository_Client_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Client'

func (*MockGithubRepository_Client_Call) Return

func (*MockGithubRepository_Client_Call) Run

func (*MockGithubRepository_Client_Call) RunAndReturn

type MockGithubRepository_CompareFiles_Call

type MockGithubRepository_CompareFiles_Call struct {
	*mock.Call
}

MockGithubRepository_CompareFiles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompareFiles'

func (*MockGithubRepository_CompareFiles_Call) Return

func (*MockGithubRepository_CompareFiles_Call) Run

func (*MockGithubRepository_CompareFiles_Call) RunAndReturn

type MockGithubRepository_Config_Call

type MockGithubRepository_Config_Call struct {
	*mock.Call
}

MockGithubRepository_Config_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Config'

func (*MockGithubRepository_Config_Call) Return

func (*MockGithubRepository_Config_Call) Run

func (*MockGithubRepository_Config_Call) RunAndReturn

type MockGithubRepository_Create_Call

type MockGithubRepository_Create_Call struct {
	*mock.Call
}

MockGithubRepository_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'

func (*MockGithubRepository_Create_Call) Return

func (*MockGithubRepository_Create_Call) Run

func (_c *MockGithubRepository_Create_Call) Run(run func(ctx context.Context, path string, ref string, data []byte, message string)) *MockGithubRepository_Create_Call

func (*MockGithubRepository_Create_Call) RunAndReturn

type MockGithubRepository_Delete_Call

type MockGithubRepository_Delete_Call struct {
	*mock.Call
}

MockGithubRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'

func (*MockGithubRepository_Delete_Call) Return

func (*MockGithubRepository_Delete_Call) Run

func (*MockGithubRepository_Delete_Call) RunAndReturn

type MockGithubRepository_Expecter

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

func (*MockGithubRepository_Expecter) Client

Client is a helper method to define mock.On call

func (*MockGithubRepository_Expecter) CompareFiles

func (_e *MockGithubRepository_Expecter) CompareFiles(ctx interface{}, base interface{}, ref interface{}) *MockGithubRepository_CompareFiles_Call

CompareFiles is a helper method to define mock.On call

  • ctx context.Context
  • base string
  • ref string

func (*MockGithubRepository_Expecter) Config

Config is a helper method to define mock.On call

func (*MockGithubRepository_Expecter) Create

func (_e *MockGithubRepository_Expecter) Create(ctx interface{}, path interface{}, ref interface{}, data interface{}, message interface{}) *MockGithubRepository_Create_Call

Create is a helper method to define mock.On call

  • ctx context.Context
  • path string
  • ref string
  • data []byte
  • message string

func (*MockGithubRepository_Expecter) Delete

func (_e *MockGithubRepository_Expecter) Delete(ctx interface{}, path interface{}, ref interface{}, message interface{}) *MockGithubRepository_Delete_Call

Delete is a helper method to define mock.On call

  • ctx context.Context
  • path string
  • ref string
  • message string

func (*MockGithubRepository_Expecter) History

func (_e *MockGithubRepository_Expecter) History(ctx interface{}, path interface{}, ref interface{}) *MockGithubRepository_History_Call

History is a helper method to define mock.On call

  • ctx context.Context
  • path string
  • ref string

func (*MockGithubRepository_Expecter) LatestRef

LatestRef is a helper method to define mock.On call

  • ctx context.Context

func (*MockGithubRepository_Expecter) ListRefs

ListRefs is a helper method to define mock.On call

  • ctx context.Context

func (*MockGithubRepository_Expecter) Move

func (_e *MockGithubRepository_Expecter) Move(ctx interface{}, oldPath interface{}, newPath interface{}, ref interface{}, message interface{}) *MockGithubRepository_Move_Call

Move is a helper method to define mock.On call

  • ctx context.Context
  • oldPath string
  • newPath string
  • ref string
  • message string

func (*MockGithubRepository_Expecter) Owner

Owner is a helper method to define mock.On call

func (*MockGithubRepository_Expecter) Read

func (_e *MockGithubRepository_Expecter) Read(ctx interface{}, path interface{}, ref interface{}) *MockGithubRepository_Read_Call

Read is a helper method to define mock.On call

  • ctx context.Context
  • path string
  • ref string

func (*MockGithubRepository_Expecter) ReadTree

func (_e *MockGithubRepository_Expecter) ReadTree(ctx interface{}, ref interface{}) *MockGithubRepository_ReadTree_Call

ReadTree is a helper method to define mock.On call

  • ctx context.Context
  • ref string

func (*MockGithubRepository_Expecter) RefURLs

func (_e *MockGithubRepository_Expecter) RefURLs(ctx interface{}, ref interface{}) *MockGithubRepository_RefURLs_Call

RefURLs is a helper method to define mock.On call

  • ctx context.Context
  • ref string

func (*MockGithubRepository_Expecter) Repo

Repo is a helper method to define mock.On call

func (*MockGithubRepository_Expecter) ResourceURLs

func (_e *MockGithubRepository_Expecter) ResourceURLs(ctx interface{}, file interface{}) *MockGithubRepository_ResourceURLs_Call

ResourceURLs is a helper method to define mock.On call

  • ctx context.Context
  • file *repository.FileInfo

func (*MockGithubRepository_Expecter) Stage

func (_e *MockGithubRepository_Expecter) Stage(ctx interface{}, opts interface{}) *MockGithubRepository_Stage_Call

Stage is a helper method to define mock.On call

  • ctx context.Context
  • opts repository.StageOptions

func (*MockGithubRepository_Expecter) Test

Test is a helper method to define mock.On call

  • ctx context.Context

func (*MockGithubRepository_Expecter) Update

func (_e *MockGithubRepository_Expecter) Update(ctx interface{}, path interface{}, ref interface{}, data interface{}, message interface{}) *MockGithubRepository_Update_Call

Update is a helper method to define mock.On call

  • ctx context.Context
  • path string
  • ref string
  • data []byte
  • message string

func (*MockGithubRepository_Expecter) Validate

Validate is a helper method to define mock.On call

func (*MockGithubRepository_Expecter) Write

func (_e *MockGithubRepository_Expecter) Write(ctx interface{}, path interface{}, ref interface{}, data interface{}, message interface{}) *MockGithubRepository_Write_Call

Write is a helper method to define mock.On call

  • ctx context.Context
  • path string
  • ref string
  • data []byte
  • message string

type MockGithubRepository_History_Call

type MockGithubRepository_History_Call struct {
	*mock.Call
}

MockGithubRepository_History_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'History'

func (*MockGithubRepository_History_Call) Return

func (*MockGithubRepository_History_Call) Run

func (*MockGithubRepository_History_Call) RunAndReturn

type MockGithubRepository_LatestRef_Call

type MockGithubRepository_LatestRef_Call struct {
	*mock.Call
}

MockGithubRepository_LatestRef_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestRef'

func (*MockGithubRepository_LatestRef_Call) Return

func (*MockGithubRepository_LatestRef_Call) Run

func (*MockGithubRepository_LatestRef_Call) RunAndReturn

type MockGithubRepository_ListRefs_Call

type MockGithubRepository_ListRefs_Call struct {
	*mock.Call
}

MockGithubRepository_ListRefs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRefs'

func (*MockGithubRepository_ListRefs_Call) Return

func (*MockGithubRepository_ListRefs_Call) Run

func (*MockGithubRepository_ListRefs_Call) RunAndReturn

type MockGithubRepository_Move_Call

type MockGithubRepository_Move_Call struct {
	*mock.Call
}

MockGithubRepository_Move_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Move'

func (*MockGithubRepository_Move_Call) Return

func (*MockGithubRepository_Move_Call) Run

func (_c *MockGithubRepository_Move_Call) Run(run func(ctx context.Context, oldPath string, newPath string, ref string, message string)) *MockGithubRepository_Move_Call

func (*MockGithubRepository_Move_Call) RunAndReturn

type MockGithubRepository_Owner_Call

type MockGithubRepository_Owner_Call struct {
	*mock.Call
}

MockGithubRepository_Owner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Owner'

func (*MockGithubRepository_Owner_Call) Return

func (*MockGithubRepository_Owner_Call) Run

func (*MockGithubRepository_Owner_Call) RunAndReturn

type MockGithubRepository_ReadTree_Call

type MockGithubRepository_ReadTree_Call struct {
	*mock.Call
}

MockGithubRepository_ReadTree_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadTree'

func (*MockGithubRepository_ReadTree_Call) Return

func (*MockGithubRepository_ReadTree_Call) Run

func (*MockGithubRepository_ReadTree_Call) RunAndReturn

type MockGithubRepository_Read_Call

type MockGithubRepository_Read_Call struct {
	*mock.Call
}

MockGithubRepository_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read'

func (*MockGithubRepository_Read_Call) Return

func (*MockGithubRepository_Read_Call) Run

func (*MockGithubRepository_Read_Call) RunAndReturn

type MockGithubRepository_RefURLs_Call

type MockGithubRepository_RefURLs_Call struct {
	*mock.Call
}

MockGithubRepository_RefURLs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RefURLs'

func (*MockGithubRepository_RefURLs_Call) Return

func (*MockGithubRepository_RefURLs_Call) Run

func (*MockGithubRepository_RefURLs_Call) RunAndReturn

type MockGithubRepository_Repo_Call

type MockGithubRepository_Repo_Call struct {
	*mock.Call
}

MockGithubRepository_Repo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Repo'

func (*MockGithubRepository_Repo_Call) Return

func (*MockGithubRepository_Repo_Call) Run

func (*MockGithubRepository_Repo_Call) RunAndReturn

type MockGithubRepository_ResourceURLs_Call

type MockGithubRepository_ResourceURLs_Call struct {
	*mock.Call
}

MockGithubRepository_ResourceURLs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResourceURLs'

func (*MockGithubRepository_ResourceURLs_Call) Return

func (*MockGithubRepository_ResourceURLs_Call) Run

func (*MockGithubRepository_ResourceURLs_Call) RunAndReturn

type MockGithubRepository_Stage_Call

type MockGithubRepository_Stage_Call struct {
	*mock.Call
}

MockGithubRepository_Stage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stage'

func (*MockGithubRepository_Stage_Call) Return

func (*MockGithubRepository_Stage_Call) Run

type MockGithubRepository_Test_Call

type MockGithubRepository_Test_Call struct {
	*mock.Call
}

MockGithubRepository_Test_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Test'

func (*MockGithubRepository_Test_Call) Return

func (*MockGithubRepository_Test_Call) Run

func (*MockGithubRepository_Test_Call) RunAndReturn

type MockGithubRepository_Update_Call

type MockGithubRepository_Update_Call struct {
	*mock.Call
}

MockGithubRepository_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update'

func (*MockGithubRepository_Update_Call) Return

func (*MockGithubRepository_Update_Call) Run

func (_c *MockGithubRepository_Update_Call) Run(run func(ctx context.Context, path string, ref string, data []byte, message string)) *MockGithubRepository_Update_Call

func (*MockGithubRepository_Update_Call) RunAndReturn

type MockGithubRepository_Validate_Call

type MockGithubRepository_Validate_Call struct {
	*mock.Call
}

MockGithubRepository_Validate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Validate'

func (*MockGithubRepository_Validate_Call) Return

func (*MockGithubRepository_Validate_Call) Run

func (*MockGithubRepository_Validate_Call) RunAndReturn

type MockGithubRepository_Write_Call

type MockGithubRepository_Write_Call struct {
	*mock.Call
}

MockGithubRepository_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write'

func (*MockGithubRepository_Write_Call) Return

func (*MockGithubRepository_Write_Call) Run

func (_c *MockGithubRepository_Write_Call) Run(run func(ctx context.Context, path string, ref string, data []byte, message string)) *MockGithubRepository_Write_Call

func (*MockGithubRepository_Write_Call) RunAndReturn

type WebhookConfig

type WebhookConfig struct {
	// The ID of the webhook.
	// Can be 0 on creation.
	ID int64
	// The events which this webhook shall contact the URL for.
	Events []string
	// Is the webhook enabled?
	Active bool
	// The URL GitHub should contact on events.
	URL string
	// The content type GitHub should send to the URL.
	// If not specified, this is "form".
	ContentType string
	// The secret to use when sending events to the URL.
	// If fetched from GitHub, this is empty as it contains no useful information.
	Secret string
}

type WebhookRepository

type WebhookRepository interface {
	Webhook(ctx context.Context, req *http.Request) (*provisioning.WebhookResponse, error)
}

type WebhookURLBuilder

type WebhookURLBuilder interface {
	WebhookURL(ctx context.Context, r *provisioning.Repository) string
}

Jump to

Keyboard shortcuts

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