testclient

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReturnValue = ReturnValueStr{} // nolint: gochecknoglobals

ReturnValue controls the error return values of API for testclient instances

Functions

func New

func New(_ context.Context, _ string) *client.Client

New returns the configured simulated gitlab API client

Types

type CommitsService

type CommitsService struct {
	Commits     map[string]*gitlab.Commit
	ReturnValue ReturnValueStr
}

CommitsService simulates the gitlab.CommitsService

func (*CommitsService) GetCommit

func (c *CommitsService) GetCommit(
	_ interface{},
	sha string,
	_ ...gitlab.OptionFunc,
) (*gitlab.Commit, *gitlab.Response, error)

GetCommit simulates the (gitlab.CommitsService).GetCommit

type IssuesService

type IssuesService struct {
	Issues      []*gitlab.Issue
	ReturnValue ReturnValueStr
}

IssuesService simulates the gitlab.IssuesService

func (*IssuesService) ListProjectIssues

func (i *IssuesService) ListProjectIssues(
	_ interface{},
	opt *gitlab.ListProjectIssuesOptions,
	_ ...gitlab.OptionFunc,
) ([]*gitlab.Issue, *gitlab.Response, error)

ListProjectIssues simulates the (gitlab.IssuesService).ListProjectIssues

type MergeRequestsService

type MergeRequestsService struct {
	MRs         []*gitlab.MergeRequest
	ReturnValue ReturnValueStr
}

MergeRequestsService sumulates the gitlab.MergeRequestsService

func (*MergeRequestsService) ListProjectMergeRequests

func (m *MergeRequestsService) ListProjectMergeRequests(
	_ interface{},
	opt *gitlab.ListProjectMergeRequestsOptions,
	_ ...gitlab.OptionFunc,
) ([]*gitlab.MergeRequest, *gitlab.Response, error)

ListProjectMergeRequests simulates the (gitlab.MergeRequestsService).ListProjectMergeRequests

type ProjectsService

type ProjectsService struct {
	ReturnValue ReturnValueStr
}

ProjectsService simulates the gitlab.ProjectsService

func (*ProjectsService) GetProject

func (p *ProjectsService) GetProject(
	_ interface{},
	_ ...gitlab.OptionFunc,
) (*gitlab.Project, *gitlab.Response, error)

GetProject simulates the (gitlab.ProjectsService).GetProject call

type ReturnValueStr

type ReturnValueStr struct {
	ProjectsServiceGetProjectRespCode               int
	CommitsServiceGetCommitRespCode                 int
	ProjectsServiceGetProjectErr                    bool
	TagsServiceListTagsErr                          bool
	MergeRequestsServiceListProjectMergeRequestsErr bool
	CommitsServiceGetCommitErr                      bool
	IssuesServiceListProjectIssuesErr               bool
}

ReturnValueStr represents the possible error return values of API if some field is true - error is return, otherise not

type TagsService

type TagsService struct {
	Tags        []*gitlab.Tag
	ReturnValue ReturnValueStr
}

TagsService sumulates the gitlab.TagsService

func (*TagsService) ListTags

func (t *TagsService) ListTags(
	_ interface{},
	opt *gitlab.ListTagsOptions,
	_ ...gitlab.OptionFunc,
) ([]*gitlab.Tag, *gitlab.Response, error)

ListTags simulates the (gitlab.TagsService).ListTags call

Jump to

Keyboard shortcuts

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