hosts

package
v0.0.0-...-e3d3006 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package hosts is a generated GoMock package.

Index

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) GetName

func (m *MockHost) GetName() string

GetName mocks base method

func (*MockHost) GetRepositories

func (m *MockHost) GetRepositories() ([]Repository, error)

GetRepositories mocks base method

func (*MockHost) GetUsers

func (m *MockHost) GetUsers() (map[string]config.User, error)

GetUsers 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

EXPECT returns an object that allows the caller to indicate expected use

func (*MockRepository) GetHost

func (m *MockRepository) GetHost() Host

GetHost mocks base method

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 (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

func (pr *PullRequest) IsApproved(team map[string]config.User, numberOfApprovals int) bool

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 (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)

type Reviewer

type Reviewer struct {
	Approved         bool
	RequestedChanges bool
	User             config.User
}

Reviewer represents a user that approves, requests changes or has not reviewed yet

Jump to

Keyboard shortcuts

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