fakegerrit

package
v0.0.0-...-1738bad Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Change

type Change struct {
	ChangeInfo *gerrit.ChangeInfo
	Comments   map[string][]*gerrit.CommentInfo
}

type FakeGerrit

type FakeGerrit struct {
	Changes  map[string]Change
	Accounts map[string]*gerrit.AccountInfo
	Projects map[string]*Project
	// contains filtered or unexported fields
}

func NewFakeGerritClient

func NewFakeGerritClient() *FakeGerrit

func (*FakeGerrit) AddAccount

func (fg *FakeGerrit) AddAccount(account *gerrit.AccountInfo)

func (*FakeGerrit) AddBranch

func (fg *FakeGerrit) AddBranch(projectName, branchName string, branch *gerrit.BranchInfo)

func (*FakeGerrit) AddChange

func (fg *FakeGerrit) AddChange(projectName string, change *gerrit.ChangeInfo)

Add a change to Fake gerrit and keep track that the change belongs to the given project

func (*FakeGerrit) GetAccount

func (fg *FakeGerrit) GetAccount(id string) *gerrit.AccountInfo

func (*FakeGerrit) GetBranch

func (fg *FakeGerrit) GetBranch(projectName, branchID string) *gerrit.BranchInfo

func (*FakeGerrit) GetChange

func (fg *FakeGerrit) GetChange(id string) *gerrit.ChangeInfo

func (*FakeGerrit) GetChangesForProject

func (fg *FakeGerrit) GetChangesForProject(projectName string, start, desiredTotal int) []*gerrit.ChangeInfo

Returns changes from project with name `projectName“. Skips the first `start` number of ChangeIDs. `desiredTotal` caps the total to a number smaller or equal to the actual total number of ChangeIDs.

func (*FakeGerrit) GetComments

func (fg *FakeGerrit) GetComments(id string) map[string][]*gerrit.CommentInfo

func (*FakeGerrit) Reset

func (fg *FakeGerrit) Reset()

func (*FakeGerrit) SetSelf

func (fg *FakeGerrit) SetSelf(id string) error

type Project

type Project struct {
	Branches  map[string]*gerrit.BranchInfo
	ChangeIDs []string
}

Jump to

Keyboard shortcuts

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