Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.
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) EnsurePackages ¶
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.
Click to show internal directories.
Click to hide internal directories.