gitlab

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParceRepositoryFullName

func ParceRepositoryFullName(webURL string) string

Types

type Client

type Client interface {
	// Issue
	GetIssue(pid int, repositoryName string) (*gitlab.Issue, error)
	Issues(opt *gitlab.ListIssuesOptions) ([]*gitlab.Issue, error)
	ProjectIssues(opt *gitlab.ListProjectIssuesOptions, repositoryName string) ([]*gitlab.Issue, error)
	CreateIssue(opt *gitlab.CreateIssueOptions, repositoryName string) (*gitlab.Issue, error)
	UpdateIssue(opt *gitlab.UpdateIssueOptions, pid int, repositoryName string) (*gitlab.Issue, error)
	// Merge Request
	GetMergeRequest(pid int, repositoryName string) (*gitlab.MergeRequest, error)
	MergeRequest(opt *gitlab.ListMergeRequestsOptions) ([]*gitlab.MergeRequest, error)
	ProjectMergeRequest(opt *gitlab.ListProjectMergeRequestsOptions, repositoryName string) ([]*gitlab.MergeRequest, error)
	CreateMergeRequest(opt *gitlab.CreateMergeRequestOptions, repositoryName string) (*gitlab.MergeRequest, error)
	UpdateMergeRequest(opt *gitlab.UpdateMergeRequestOptions, pid int, repositoryName string) (*gitlab.MergeRequest, error)
	// Project
	Projects(opt *gitlab.ListProjectsOptions) ([]*gitlab.Project, error)
	// Pipeline
	ProjectPipelines(repositoryName string, opt *gitlab.ListProjectPipelinesOptions) (gitlab.PipelineList, error)
	// Lint
	Lint(content string) (*gitlab.LintResult, error)
}

type GitlabProvider

type GitlabProvider struct {
	UI            ui.Ui
	GitClient     git.Client
	ConfigManager *config.ConfigManager
}

func NewProvider

func NewProvider(ui ui.Ui, gitClient git.Client, configManager *config.ConfigManager) *GitlabProvider

func (*GitlabProvider) GetClient

func (p *GitlabProvider) GetClient(remote *git.RemoteInfo) (Client, error)

func (*GitlabProvider) GetCurrentRemote

func (p *GitlabProvider) GetCurrentRemote() (*git.RemoteInfo, error)

func (*GitlabProvider) GetSpecificRemote

func (p *GitlabProvider) GetSpecificRemote(namespace, project string) *git.RemoteInfo

func (*GitlabProvider) Init

func (p *GitlabProvider) Init() error

type LabClient

type LabClient struct {
	Client *gitlab.Client
}

func NewLabClient

func NewLabClient(client *gitlab.Client) *LabClient

func (*LabClient) CreateIssue

func (l *LabClient) CreateIssue(opt *gitlab.CreateIssueOptions, repositoryName string) (*gitlab.Issue, error)

func (*LabClient) CreateMergeRequest

func (l *LabClient) CreateMergeRequest(opt *gitlab.CreateMergeRequestOptions, repositoryName string) (*gitlab.MergeRequest, error)

func (*LabClient) GetIssue added in v0.2.0

func (l *LabClient) GetIssue(pid int, repositoryName string) (*gitlab.Issue, error)

func (*LabClient) GetMergeRequest added in v0.2.0

func (l *LabClient) GetMergeRequest(pid int, repositoryName string) (*gitlab.MergeRequest, error)

func (*LabClient) Issues

func (l *LabClient) Issues(opt *gitlab.ListIssuesOptions) ([]*gitlab.Issue, error)

func (*LabClient) Lint added in v0.2.0

func (l *LabClient) Lint(content string) (*gitlab.LintResult, error)

func (*LabClient) MergeRequest

func (l *LabClient) MergeRequest(opt *gitlab.ListMergeRequestsOptions) ([]*gitlab.MergeRequest, error)

func (*LabClient) ProjectIssues

func (l *LabClient) ProjectIssues(opt *gitlab.ListProjectIssuesOptions, repositoryName string) ([]*gitlab.Issue, error)

func (*LabClient) ProjectMergeRequest

func (l *LabClient) ProjectMergeRequest(opt *gitlab.ListProjectMergeRequestsOptions, repositoryName string) ([]*gitlab.MergeRequest, error)

func (*LabClient) ProjectPipelines added in v0.2.0

func (l *LabClient) ProjectPipelines(repositoryName string, opt *gitlab.ListProjectPipelinesOptions) (gitlab.PipelineList, error)

func (*LabClient) Projects added in v0.2.0

func (l *LabClient) Projects(opt *gitlab.ListProjectsOptions) ([]*gitlab.Project, error)

func (*LabClient) UpdateIssue added in v0.2.0

func (l *LabClient) UpdateIssue(opt *gitlab.UpdateIssueOptions, pid int, repositoryName string) (*gitlab.Issue, error)

func (*LabClient) UpdateMergeRequest added in v0.2.0

func (l *LabClient) UpdateMergeRequest(opt *gitlab.UpdateMergeRequestOptions, pid int, repositoryName string) (*gitlab.MergeRequest, error)

type MockLabClient

type MockLabClient struct {
	Client
	// Issue
	MockGetIssue      func(pid int, repositoryName string) (*gitlab.Issue, error)
	MockIssues        func(opt *gitlab.ListIssuesOptions) ([]*gitlab.Issue, error)
	MockProjectIssues func(opt *gitlab.ListProjectIssuesOptions, repositoryName string) ([]*gitlab.Issue, error)
	MockCreateIssue   func(opt *gitlab.CreateIssueOptions, repositoryName string) (*gitlab.Issue, error)
	MockUpdateIssue   func(opt *gitlab.UpdateIssueOptions, pid int, repositoryName string) (*gitlab.Issue, error)
	// Merge Request
	MockGetMergeRequest     func(pid int, repositoryName string) (*gitlab.MergeRequest, error)
	MockMergeRequest        func(opt *gitlab.ListMergeRequestsOptions) ([]*gitlab.MergeRequest, error)
	MockProjectMergeRequest func(opt *gitlab.ListProjectMergeRequestsOptions, repositoryName string) ([]*gitlab.MergeRequest, error)
	MockCreateMergeRequest  func(opt *gitlab.CreateMergeRequestOptions, repositoryName string) (*gitlab.MergeRequest, error)
	MockUpdateMergeRequest  func(opt *gitlab.UpdateMergeRequestOptions, pid int, repositoryName string) (*gitlab.MergeRequest, error)
	// Project
	MockProjects func(opt *gitlab.ListProjectsOptions) ([]*gitlab.Project, error)
	// Pipeline
	MockProjectPipelines func(repositoryName string, opt *gitlab.ListProjectPipelinesOptions) (gitlab.PipelineList, error)
	// Lint
	MockLint func(content string) (*gitlab.LintResult, error)
}

func (*MockLabClient) CreateIssue

func (m *MockLabClient) CreateIssue(opt *gitlab.CreateIssueOptions, repositoryName string) (*gitlab.Issue, error)

func (*MockLabClient) CreateMergeRequest

func (m *MockLabClient) CreateMergeRequest(opt *gitlab.CreateMergeRequestOptions, repositoryName string) (*gitlab.MergeRequest, error)

func (*MockLabClient) GetIssue added in v0.2.0

func (m *MockLabClient) GetIssue(pid int, repositoryName string) (*gitlab.Issue, error)

func (*MockLabClient) GetMergeRequest added in v0.2.0

func (m *MockLabClient) GetMergeRequest(pid int, repositoryName string) (*gitlab.MergeRequest, error)

func (*MockLabClient) Issues

func (m *MockLabClient) Issues(opt *gitlab.ListIssuesOptions) ([]*gitlab.Issue, error)

func (*MockLabClient) Lint added in v0.2.0

func (m *MockLabClient) Lint(content string) (*gitlab.LintResult, error)

func (*MockLabClient) MergeRequest

func (*MockLabClient) ProjectIssues

func (m *MockLabClient) ProjectIssues(opt *gitlab.ListProjectIssuesOptions, repositoryName string) ([]*gitlab.Issue, error)

func (*MockLabClient) ProjectMergeRequest

func (m *MockLabClient) ProjectMergeRequest(opt *gitlab.ListProjectMergeRequestsOptions, repositoryName string) ([]*gitlab.MergeRequest, error)

func (*MockLabClient) ProjectPipelines added in v0.2.0

func (m *MockLabClient) ProjectPipelines(repositoryName string, opt *gitlab.ListProjectPipelinesOptions) (gitlab.PipelineList, error)

func (*MockLabClient) Projects added in v0.2.0

func (m *MockLabClient) Projects(opt *gitlab.ListProjectsOptions) ([]*gitlab.Project, error)

func (*MockLabClient) UpdateIssue added in v0.2.0

func (m *MockLabClient) UpdateIssue(opt *gitlab.UpdateIssueOptions, pid int, repositoryName string) (*gitlab.Issue, error)

func (*MockLabClient) UpdateMergeRequest added in v0.2.0

func (m *MockLabClient) UpdateMergeRequest(opt *gitlab.UpdateMergeRequestOptions, pid int, repositoryName string) (*gitlab.MergeRequest, error)

type MockProvider

type MockProvider struct {
	Provider
	MockInit              func() error
	MockGetSpecificRemote func(namespace, project string) *git.RemoteInfo
	MockGetCurrentRemote  func() (*git.RemoteInfo, error)
	MockGetClient         func(remote *git.RemoteInfo) (Client, error)
}

func (*MockProvider) GetClient

func (m *MockProvider) GetClient(remote *git.RemoteInfo) (Client, error)

func (*MockProvider) GetCurrentRemote

func (m *MockProvider) GetCurrentRemote() (*git.RemoteInfo, error)

func (*MockProvider) GetSpecificRemote

func (m *MockProvider) GetSpecificRemote(namespace, project string) *git.RemoteInfo

func (*MockProvider) Init

func (m *MockProvider) Init() error

type Provider

type Provider interface {
	Init() error
	GetSpecificRemote(namespace, project string) *git.RemoteInfo
	GetCurrentRemote() (*git.RemoteInfo, error)
	GetClient(remote *git.RemoteInfo) (Client, error)
}

Jump to

Keyboard shortcuts

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