cipd

package
v0.0.0-...-9994f1b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Factory

func Factory(packages map[string]*Package) real.ClientFactory

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.

Types

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

func (c *Client) Ensure(ctx context.Context, serviceUrl, cipdRoot string, packages map[string]*real.Package) (map[string]string, 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