Documentation
¶
Index ¶
- type Adapter
- type Factory
- type GHE
- type MockAdapter
- func (_m *MockAdapter) EXPECT() *MockAdapter_Expecter
- func (_m *MockAdapter) MetadataToGHE(ctx context.Context, metadata *datastore.Metadata) (GHE, error)
- func (_m *MockAdapter) PREventToGHE(ctx context.Context, event *github.PullRequestEvent) (GHE, error)
- func (_m *MockAdapter) PRReviewEventToGHE(ctx context.Context, event *github.PullRequestReviewEvent) (GHE, error)
- type MockAdapter_Expecter
- func (_e *MockAdapter_Expecter) MetadataToGHE(ctx interface{}, metadata interface{}) *MockAdapter_MetadataToGHE_Call
- func (_e *MockAdapter_Expecter) PREventToGHE(ctx interface{}, event interface{}) *MockAdapter_PREventToGHE_Call
- func (_e *MockAdapter_Expecter) PRReviewEventToGHE(ctx interface{}, event interface{}) *MockAdapter_PRReviewEventToGHE_Call
- type MockAdapter_MetadataToGHE_Call
- func (_c *MockAdapter_MetadataToGHE_Call) Return(_a0 GHE, _a1 error) *MockAdapter_MetadataToGHE_Call
- func (_c *MockAdapter_MetadataToGHE_Call) Run(run func(ctx context.Context, metadata *datastore.Metadata)) *MockAdapter_MetadataToGHE_Call
- func (_c *MockAdapter_MetadataToGHE_Call) RunAndReturn(run func(context.Context, *datastore.Metadata) (GHE, error)) *MockAdapter_MetadataToGHE_Call
- type MockAdapter_PREventToGHE_Call
- func (_c *MockAdapter_PREventToGHE_Call) Return(_a0 GHE, _a1 error) *MockAdapter_PREventToGHE_Call
- func (_c *MockAdapter_PREventToGHE_Call) Run(run func(ctx context.Context, event *github.PullRequestEvent)) *MockAdapter_PREventToGHE_Call
- func (_c *MockAdapter_PREventToGHE_Call) RunAndReturn(run func(context.Context, *github.PullRequestEvent) (GHE, error)) *MockAdapter_PREventToGHE_Call
- type MockAdapter_PRReviewEventToGHE_Call
- func (_c *MockAdapter_PRReviewEventToGHE_Call) Return(_a0 GHE, _a1 error) *MockAdapter_PRReviewEventToGHE_Call
- func (_c *MockAdapter_PRReviewEventToGHE_Call) Run(run func(ctx context.Context, event *github.PullRequestReviewEvent)) *MockAdapter_PRReviewEventToGHE_Call
- func (_c *MockAdapter_PRReviewEventToGHE_Call) RunAndReturn(run func(context.Context, *github.PullRequestReviewEvent) (GHE, error)) *MockAdapter_PRReviewEventToGHE_Call
- type MockFactory
- type MockFactory_CreateModel_Call
- func (_c *MockFactory_CreateModel_Call) Return(_a0 *Model, _a1 error) *MockFactory_CreateModel_Call
- func (_c *MockFactory_CreateModel_Call) Run(run func(ctx context.Context, ghe GHE)) *MockFactory_CreateModel_Call
- func (_c *MockFactory_CreateModel_Call) RunAndReturn(run func(context.Context, GHE) (*Model, error)) *MockFactory_CreateModel_Call
- type MockFactory_Expecter
- type Model
- type Plugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface {
PREventToGHE(ctx context.Context, event *github.PullRequestEvent) (GHE, error)
MetadataToGHE(ctx context.Context, metadata *datastore.Metadata) (GHE, error)
PRReviewEventToGHE(ctx context.Context, event *github.PullRequestReviewEvent) (GHE, error)
}
func NewAdapter ¶
type Factory ¶
func NewFactory ¶
type GHE ¶
type GHE struct {
Event string `json:"event"`
Action string `json:"action"`
PullRequest *github.PullRequest `json:"pull_request,omitempty"`
Repository *github.Repository `json:"repository,omitempty"`
Organization *github.Organization `json:"organization,omitempty"`
}
type MockAdapter ¶
MockAdapter is an autogenerated mock type for the Adapter type
func NewMockAdapter ¶
func NewMockAdapter(t interface {
mock.TestingT
Cleanup(func())
}) *MockAdapter
NewMockAdapter creates a new instance of MockAdapter. 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 (*MockAdapter) EXPECT ¶
func (_m *MockAdapter) EXPECT() *MockAdapter_Expecter
func (*MockAdapter) MetadataToGHE ¶
func (_m *MockAdapter) MetadataToGHE(ctx context.Context, metadata *datastore.Metadata) (GHE, error)
MetadataToGHE provides a mock function with given fields: ctx, metadata
func (*MockAdapter) PREventToGHE ¶
func (_m *MockAdapter) PREventToGHE(ctx context.Context, event *github.PullRequestEvent) (GHE, error)
PREventToGHE provides a mock function with given fields: ctx, event
func (*MockAdapter) PRReviewEventToGHE ¶
func (_m *MockAdapter) PRReviewEventToGHE(ctx context.Context, event *github.PullRequestReviewEvent) (GHE, error)
PRReviewEventToGHE provides a mock function with given fields: ctx, event
type MockAdapter_Expecter ¶
type MockAdapter_Expecter struct {
// contains filtered or unexported fields
}
func (*MockAdapter_Expecter) MetadataToGHE ¶
func (_e *MockAdapter_Expecter) MetadataToGHE(ctx interface{}, metadata interface{}) *MockAdapter_MetadataToGHE_Call
MetadataToGHE is a helper method to define mock.On call
- ctx context.Context
- metadata *datastore.Metadata
func (*MockAdapter_Expecter) PREventToGHE ¶
func (_e *MockAdapter_Expecter) PREventToGHE(ctx interface{}, event interface{}) *MockAdapter_PREventToGHE_Call
PREventToGHE is a helper method to define mock.On call
- ctx context.Context
- event *github.PullRequestEvent
func (*MockAdapter_Expecter) PRReviewEventToGHE ¶
func (_e *MockAdapter_Expecter) PRReviewEventToGHE(ctx interface{}, event interface{}) *MockAdapter_PRReviewEventToGHE_Call
PRReviewEventToGHE is a helper method to define mock.On call
- ctx context.Context
- event *github.PullRequestReviewEvent
type MockAdapter_MetadataToGHE_Call ¶
MockAdapter_MetadataToGHE_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MetadataToGHE'
func (*MockAdapter_MetadataToGHE_Call) Return ¶
func (_c *MockAdapter_MetadataToGHE_Call) Return(_a0 GHE, _a1 error) *MockAdapter_MetadataToGHE_Call
func (*MockAdapter_MetadataToGHE_Call) Run ¶
func (_c *MockAdapter_MetadataToGHE_Call) Run(run func(ctx context.Context, metadata *datastore.Metadata)) *MockAdapter_MetadataToGHE_Call
func (*MockAdapter_MetadataToGHE_Call) RunAndReturn ¶
func (_c *MockAdapter_MetadataToGHE_Call) RunAndReturn(run func(context.Context, *datastore.Metadata) (GHE, error)) *MockAdapter_MetadataToGHE_Call
type MockAdapter_PREventToGHE_Call ¶
MockAdapter_PREventToGHE_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PREventToGHE'
func (*MockAdapter_PREventToGHE_Call) Return ¶
func (_c *MockAdapter_PREventToGHE_Call) Return(_a0 GHE, _a1 error) *MockAdapter_PREventToGHE_Call
func (*MockAdapter_PREventToGHE_Call) Run ¶
func (_c *MockAdapter_PREventToGHE_Call) Run(run func(ctx context.Context, event *github.PullRequestEvent)) *MockAdapter_PREventToGHE_Call
func (*MockAdapter_PREventToGHE_Call) RunAndReturn ¶
func (_c *MockAdapter_PREventToGHE_Call) RunAndReturn(run func(context.Context, *github.PullRequestEvent) (GHE, error)) *MockAdapter_PREventToGHE_Call
type MockAdapter_PRReviewEventToGHE_Call ¶
MockAdapter_PRReviewEventToGHE_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PRReviewEventToGHE'
func (*MockAdapter_PRReviewEventToGHE_Call) Return ¶
func (_c *MockAdapter_PRReviewEventToGHE_Call) Return(_a0 GHE, _a1 error) *MockAdapter_PRReviewEventToGHE_Call
func (*MockAdapter_PRReviewEventToGHE_Call) Run ¶
func (_c *MockAdapter_PRReviewEventToGHE_Call) Run(run func(ctx context.Context, event *github.PullRequestReviewEvent)) *MockAdapter_PRReviewEventToGHE_Call
func (*MockAdapter_PRReviewEventToGHE_Call) RunAndReturn ¶
func (_c *MockAdapter_PRReviewEventToGHE_Call) RunAndReturn(run func(context.Context, *github.PullRequestReviewEvent) (GHE, error)) *MockAdapter_PRReviewEventToGHE_Call
type MockFactory ¶
MockFactory is an autogenerated mock type for the Factory type
func NewMockFactory ¶
func NewMockFactory(t interface {
mock.TestingT
Cleanup(func())
}) *MockFactory
NewMockFactory creates a new instance of MockFactory. 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 (*MockFactory) CreateModel ¶
CreateModel provides a mock function with given fields: ctx, ghe
func (*MockFactory) EXPECT ¶
func (_m *MockFactory) EXPECT() *MockFactory_Expecter
type MockFactory_CreateModel_Call ¶
MockFactory_CreateModel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateModel'
func (*MockFactory_CreateModel_Call) Return ¶
func (_c *MockFactory_CreateModel_Call) Return(_a0 *Model, _a1 error) *MockFactory_CreateModel_Call
func (*MockFactory_CreateModel_Call) Run ¶
func (_c *MockFactory_CreateModel_Call) Run(run func(ctx context.Context, ghe GHE)) *MockFactory_CreateModel_Call
func (*MockFactory_CreateModel_Call) RunAndReturn ¶
func (_c *MockFactory_CreateModel_Call) RunAndReturn(run func(context.Context, GHE) (*Model, error)) *MockFactory_CreateModel_Call
type MockFactory_Expecter ¶
type MockFactory_Expecter struct {
// contains filtered or unexported fields
}
func (*MockFactory_Expecter) CreateModel ¶
func (_e *MockFactory_Expecter) CreateModel(ctx interface{}, ghe interface{}) *MockFactory_CreateModel_Call
CreateModel is a helper method to define mock.On call
- ctx context.Context
- ghe GHE
type Model ¶
type Model struct {
Event string `json:"event"`
Action string `json:"action"`
PullRequest *github.PullRequest `json:"pull_request,omitempty"`
Repository *github.Repository `json:"repository,omitempty"`
Organization *github.Organization `json:"organization,omitempty"`
Plugins map[string]json.RawMessage `json:"plugins"`
}