cipd

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ensure

func Ensure(ctx context.Context, serviceUrl, cipdRoot string, packages map[string]*Package) (map[string]*ResolvedPackage, error)

func UseClientFactory

func UseClientFactory(ctx context.Context, factory ClientFactory) context.Context

UseClientFactory returns a context that causes new Client instances to be created using the given factory.

Types

type Client

type Client interface {
	// Ensure downloads packages from a given CIPD service to the given CIPD root.
	//
	// The packages download are given as a map of subdirectories to the package to download to
	// the subdirectory.
	//
	// If the operation is successful a map containing resolved packages and a nil error will be
	// returned. The map of resolved packages maps the subdirectory to a Package instance where
	// the version has been resolved to an instance ID. In the case of an error, a nil map and
	// non-nil error will be returned.
	Ensure(ctx context.Context, serviceUrl, cipdRoot string, packages map[string]*Package) (map[string]string, error)
}

Client provides operations for interacting with CIPD.

type ClientFactory

type ClientFactory func(ctx context.Context) Client

ClientFactory creates the client for accessing CIPD.

type Package

type Package struct {
	// Name is the name of the package to ensure
	Name string
	// Version is the version of the package to ensure
	Version string
}

Package is the details of a package to ensure

type ResolvedPackage

type ResolvedPackage struct {
	// Name is the name of the package that was downloaded
	Name string
	// RequestedVersion is the version of the package that was requested
	RequestedVersion string
	// ActualVersion is the resolved version of the package that was downloaded
	ActualVersion string
}

Jump to

Keyboard shortcuts

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