input

package
v0.0.0-...-e9abc8a Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

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

func NewAdapter(dao gh.API) Adapter

type Factory

type Factory interface {
	CreateModel(ctx context.Context, ghe GHE) (*Model, error)
}

func NewFactory

func NewFactory(plugins ...Plugin) Factory

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"`
}

func (GHE) ToID

func (ghe GHE) ToID() id.PR

type MockAdapter

type MockAdapter struct {
	mock.Mock
}

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

type MockAdapter_MetadataToGHE_Call struct {
	*mock.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 (*MockAdapter_MetadataToGHE_Call) Run

func (*MockAdapter_MetadataToGHE_Call) RunAndReturn

type MockAdapter_PREventToGHE_Call

type MockAdapter_PREventToGHE_Call struct {
	*mock.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 (*MockAdapter_PREventToGHE_Call) Run

func (*MockAdapter_PREventToGHE_Call) RunAndReturn

type MockAdapter_PRReviewEventToGHE_Call

type MockAdapter_PRReviewEventToGHE_Call struct {
	*mock.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 (*MockAdapter_PRReviewEventToGHE_Call) Run

func (*MockAdapter_PRReviewEventToGHE_Call) RunAndReturn

type MockFactory

type MockFactory struct {
	mock.Mock
}

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

func (_m *MockFactory) CreateModel(ctx context.Context, ghe GHE) (*Model, error)

CreateModel provides a mock function with given fields: ctx, ghe

func (*MockFactory) EXPECT

func (_m *MockFactory) EXPECT() *MockFactory_Expecter

type MockFactory_CreateModel_Call

type MockFactory_CreateModel_Call struct {
	*mock.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 (*MockFactory_CreateModel_Call) Run

func (*MockFactory_CreateModel_Call) RunAndReturn

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"`
}

type Plugin

type Plugin interface {
	GetInputMsg(ctx context.Context, ghe GHE) (json.RawMessage, error)
	Name() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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