v0.0.0-...-e560ebb Latest Latest

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 8 Imported by: 0




This section is empty.


This section is empty.


func Factory

func Factory(packages map[string]*Package) bscipd.CipdClientFactory

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

The fake data is taken from the packages argument, which is a map from package names to the Package instances containing the fake data for the package. Missing keys will have a default Package. A nil value indicates that the given package is not the name of a package.


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) EnsurePackages

func (c *Client) EnsurePackages(ctx context.Context, packages common.PinSliceBySubdir, paranoia cipd.ParanoidMode, dryRun bool) (cipd.ActionMap, error)

func (*Client) ResolveVersion

func (c *Client) ResolveVersion(ctx context.Context, packageName, version string) (common.Pin, error)

type Package

type Package struct {
	// Refs maps refs to their instance IDs.
	// Missing keys will have a default instance ID computed. An empty
	// string value indicates that the ref does not exist.
	Refs map[string]string

	// Instances maps instance IDs to the instances.
	// Missing keys will have a default instance. A nil value indicates that
	// the instance does not exist.
	Instances map[string]*PackageInstance

Package is the fake data for a package including its refs and all its instances.

type PackageInstance

type PackageInstance struct {
	// Contents maps file paths to the contents.
	Contents map[string]string

PackageInstance is the fake data for an instance of a package.

Jump to

Keyboard shortcuts

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