Documentation
¶
Overview ¶
Package hosts is a generated GoMock package.
Index ¶
- type Host
- type MockHost
- type MockHostMockRecorder
- type MockRepository
- func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
- func (m *MockRepository) GetHost() Host
- func (m *MockRepository) GetLink() string
- func (m *MockRepository) GetName() string
- func (m *MockRepository) GetPullRequestsToDisplay() ([]*PullRequest, []*PullRequest)
- func (m *MockRepository) HasPullRequestsToDisplay() bool
- type MockRepositoryMockRecorder
- func (mr *MockRepositoryMockRecorder) GetHost() *gomock.Call
- func (mr *MockRepositoryMockRecorder) GetLink() *gomock.Call
- func (mr *MockRepositoryMockRecorder) GetName() *gomock.Call
- func (mr *MockRepositoryMockRecorder) GetPullRequestsToDisplay() *gomock.Call
- func (mr *MockRepositoryMockRecorder) HasPullRequestsToDisplay() *gomock.Call
- type PullRequest
- type Repository
- type RepositoryImpl
- func (repository *RepositoryImpl) GetHost() Host
- func (repository *RepositoryImpl) GetLink() string
- func (repository *RepositoryImpl) GetName() string
- func (repository *RepositoryImpl) GetPullRequestsToDisplay() (readyToMerge []*PullRequest, readyToReview []*PullRequest)
- func (repository *RepositoryImpl) HasPullRequestsToDisplay() bool
- type Reviewer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Host ¶
type Host interface { GetConfig() *config.TeamConfig GetName() string GetRepositories() ([]Repository, error) GetUsers() (map[string]config.User, error) }
Host represents a SCM provider
func GetHosts ¶
func GetHosts(config *config.TeamConfig) []Host
GetHosts returns all configured Hosts (SCM providers)
type MockHost ¶
type MockHost struct {
// contains filtered or unexported fields
}
MockHost is a mock of Host interface
func NewMockHost ¶
func NewMockHost(ctrl *gomock.Controller) *MockHost
NewMockHost creates a new mock instance
func (*MockHost) EXPECT ¶
func (m *MockHost) EXPECT() *MockHostMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockHost) GetConfig ¶
func (m *MockHost) GetConfig() *config.TeamConfig
GetConfig mocks base method
func (*MockHost) GetRepositories ¶
func (m *MockHost) GetRepositories() ([]Repository, error)
GetRepositories mocks base method
type MockHostMockRecorder ¶
type MockHostMockRecorder struct {
// contains filtered or unexported fields
}
MockHostMockRecorder is the mock recorder for MockHost
func (*MockHostMockRecorder) GetConfig ¶
func (mr *MockHostMockRecorder) GetConfig() *gomock.Call
GetConfig indicates an expected call of GetConfig
func (*MockHostMockRecorder) GetName ¶
func (mr *MockHostMockRecorder) GetName() *gomock.Call
GetName indicates an expected call of GetName
func (*MockHostMockRecorder) GetRepositories ¶
func (mr *MockHostMockRecorder) GetRepositories() *gomock.Call
GetRepositories indicates an expected call of GetRepositories
func (*MockHostMockRecorder) GetUsers ¶
func (mr *MockHostMockRecorder) GetUsers() *gomock.Call
GetUsers indicates an expected call of GetUsers
type MockRepository ¶
type MockRepository struct {
// contains filtered or unexported fields
}
MockRepository is a mock of Repository interface
func NewMockRepository ¶
func NewMockRepository(ctrl *gomock.Controller) *MockRepository
NewMockRepository creates a new mock instance
func (*MockRepository) EXPECT ¶
func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockRepository) GetLink ¶
func (m *MockRepository) GetLink() string
GetLink mocks base method
func (*MockRepository) GetName ¶
func (m *MockRepository) GetName() string
GetName mocks base method
func (*MockRepository) GetPullRequestsToDisplay ¶
func (m *MockRepository) GetPullRequestsToDisplay() ([]*PullRequest, []*PullRequest)
GetPullRequestsToDisplay mocks base method
func (*MockRepository) HasPullRequestsToDisplay ¶
func (m *MockRepository) HasPullRequestsToDisplay() bool
HasPullRequestsToDisplay mocks base method
type MockRepositoryMockRecorder ¶
type MockRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockRepositoryMockRecorder is the mock recorder for MockRepository
func (*MockRepositoryMockRecorder) GetHost ¶
func (mr *MockRepositoryMockRecorder) GetHost() *gomock.Call
GetHost indicates an expected call of GetHost
func (*MockRepositoryMockRecorder) GetLink ¶
func (mr *MockRepositoryMockRecorder) GetLink() *gomock.Call
GetLink indicates an expected call of GetLink
func (*MockRepositoryMockRecorder) GetName ¶
func (mr *MockRepositoryMockRecorder) GetName() *gomock.Call
GetName indicates an expected call of GetName
func (*MockRepositoryMockRecorder) GetPullRequestsToDisplay ¶
func (mr *MockRepositoryMockRecorder) GetPullRequestsToDisplay() *gomock.Call
GetPullRequestsToDisplay indicates an expected call of GetPullRequestsToDisplay
func (*MockRepositoryMockRecorder) HasPullRequestsToDisplay ¶
func (mr *MockRepositoryMockRecorder) HasPullRequestsToDisplay() *gomock.Call
HasPullRequestsToDisplay indicates an expected call of HasPullRequestsToDisplay
type PullRequest ¶
type PullRequest struct { Author config.User Description string Link string Reviewers []*Reviewer Title string CreateTime time.Time UpdateTime time.Time }
PullRequest represent a pull (or merge) request on a SCM provider
func (*PullRequest) IsApproved ¶
IsApproved returns true if the pull request is approved and ready to merge
func (*PullRequest) IsFromOneOfUsers ¶
func (pr *PullRequest) IsFromOneOfUsers(team map[string]config.User) bool
IsFromOneOfUsers returns true if the pull request was submitted by one of the given users
func (*PullRequest) IsWIP ¶
func (pr *PullRequest) IsWIP() bool
IsWIP returns true if the pull request is marked as a work in progress
func (*PullRequest) TeamReviewers ¶
func (pr *PullRequest) TeamReviewers(team map[string]config.User) []*Reviewer
TeamReviewers returns all the reviewers that are in the given list of usernames (the team)
type Repository ¶
type Repository interface { GetHost() Host GetLink() string GetName() string GetPullRequestsToDisplay() (readyToMerge []*PullRequest, readyToReview []*PullRequest) HasPullRequestsToDisplay() bool }
Repository represents a repository on a SCM provider
type RepositoryImpl ¶
type RepositoryImpl struct { Host Host Link string Name string OpenPullRequests []*PullRequest }
RepositoryImpl is the implementation of the Repository interface.
func NewRepository ¶
func NewRepository(host Host, name, link string, openPullRequests []*PullRequest) *RepositoryImpl
NewRepository creates a RepositoryImpl instance
func (*RepositoryImpl) GetHost ¶
func (repository *RepositoryImpl) GetHost() Host
GetHost returns a repository's host
func (*RepositoryImpl) GetLink ¶
func (repository *RepositoryImpl) GetLink() string
GetLink returns a repository's URL
func (*RepositoryImpl) GetName ¶
func (repository *RepositoryImpl) GetName() string
GetName returns a repository's name
func (*RepositoryImpl) GetPullRequestsToDisplay ¶
func (repository *RepositoryImpl) GetPullRequestsToDisplay() (readyToMerge []*PullRequest, readyToReview []*PullRequest)
GetPullRequestsToDisplay returns all pull requests that are either waiting for approvals or ready to merge
func (*RepositoryImpl) HasPullRequestsToDisplay ¶
func (repository *RepositoryImpl) HasPullRequestsToDisplay() bool
HasPullRequestsToDisplay returns true if at least one of the pull requests needs action by the team (ready to merge or needs approval)