gerrit

package
v0.0.0-...-3c039c4 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Factory

func Factory(fakes map[string]*Host) gerrit.GerritClientFactory

Factory creates a factory that returns RPC clients that use fake data to respond to requests.

The fake data is taken from the fakes argument, which is a map from host names to the Host instances containing the fake data for the host. Missing keys will have a default Host. A nil value indicates that the given host is not a gerrit instance.

Types

type Change

type Change struct {
	// Ref is the target ref for the change.
	Ref string
	// Patchsets maps patchset number (>0) to details of the patchset.
	//
	// Revision info will be generated for each patchset with number up to
	// the greatest key. If no patchsets are provided, the change will have
	// one patchset generated. Any generated patchsets will have a generated
	// revision but affect no files. A nil value will be treated as a
	// default Patchset.
	Patchsets map[int32]*Patchset
}

Change is the fake data for a gerrit change.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the client that will serve fake data for a given host.

func (*Client) GetChange

func (c *Client) GetChange(ctx context.Context, request *gerritpb.GetChangeRequest, opts ...grpc.CallOption) (*gerritpb.ChangeInfo, error)

type Host

type Host struct {
	// Projects maps project names to their details.
	//
	// Missing keys will have a default fake project. A nil value indicates
	// the the project does not exist.
	Projects map[string]*Project
}

Host is the fake data for a gerrit host.

type Patchset

type Patchset struct {
	// Revision is the git revision of the change in the corresponding
	// gitiles host.
	Revision string
}

Patchset is the fake data for a patchset of a change.

type Project

type Project struct {
	Changes map[int64]*Change
}

Project is the fake data for a gerrit project.

Jump to

Keyboard shortcuts

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