gitlab

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 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 {
	Issues(opt *gitlab.ListIssuesOptions) ([]*gitlab.Issue, error)
	ProjectIssues(opt *gitlab.ListProjectIssuesOptions, repositoryName string) ([]*gitlab.Issue, error)
	MergeRequest(opt *gitlab.ListMergeRequestsOptions) ([]*gitlab.MergeRequest, error)
	ProjectMergeRequest(opt *gitlab.ListProjectMergeRequestsOptions, repositoryName string) ([]*gitlab.MergeRequest, error)
	CreateIssue(opt *gitlab.CreateIssueOptions, repositoryName string) (*gitlab.Issue, error)
	CreateMergeRequest(opt *gitlab.CreateMergeRequestOptions, repositoryName string) (*gitlab.MergeRequest, 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) Issues

func (l *LabClient) Issues(opt *gitlab.ListIssuesOptions) ([]*gitlab.Issue, 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)

type MockLabClient

type MockLabClient struct {
	MockIssues              func(opt *gitlab.ListIssuesOptions) ([]*gitlab.Issue, error)
	MockProjectIssues       func(opt *gitlab.ListProjectIssuesOptions, repositoryName string) ([]*gitlab.Issue, error)
	MockMergeRequest        func(opt *gitlab.ListMergeRequestsOptions) ([]*gitlab.MergeRequest, error)
	MockProjectMergeRequest func(opt *gitlab.ListProjectMergeRequestsOptions, repositoryName string) ([]*gitlab.MergeRequest, error)
	MockCreateIssue         func(opt *gitlab.CreateIssueOptions, repositoryName string) (*gitlab.Issue, error)
	MockCreateMergeRequest  func(opt *gitlab.CreateMergeRequestOptions, repositoryName string) (*gitlab.MergeRequest, 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) Issues

func (m *MockLabClient) Issues(opt *gitlab.ListIssuesOptions) ([]*gitlab.Issue, 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)

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