{"modulePath":"github.1git.de/docker/cli","version":"v27.2.1+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package test\n\nPackage test is a test-only package that can be used by other cli package to write unit test.\n\nIt as an internal package and cannot be used outside of github.com/docker/cli package.\n\n## Functions\n\n```go\nfunc CompareMultipleValues(t *testing.T, value, expected string)\n```\nCompareMultipleValues compares comma-separated values, whatever the order is\n\n```go\nfunc EnableContentTrust(c *FakeCli)\n```\nEnableContentTrust on the fake cli\n\n```go\nfunc NewFakeStore() credentials.Store\n```\nNewFakeStore creates a new file credentials store.\n\n```go\nfunc NewWriterWithHook(actualWriter io.Writer, hook func([]byte)) *writerWithHook\n```\nNewWriterWithHook returns a io.Writer that still writes to the actualWriter but also calls the hook function after every write. It is useful to use this function when you need to wait for a writer to complete writing inside a test.\n\n```go\nfunc TerminatePrompt(ctx context.Context, t *testing.T, cmd *cobra.Command, cli *FakeCli)\n```\n\n## Types\n\n```go\ntype FakeCli struct {\n\tcommand.DockerCli\n\t// contains filtered or unexported fields\n}\n```\nFakeCli emulates the default DockerCli\n\n```go\nfunc NewFakeCli(apiClient client.APIClient, opts ...func(*FakeCli)) *FakeCli\n```\nNewFakeCli returns a fake for the command.Cli interface\n\n```go\nfunc (c *FakeCli) BuildKitEnabled() (bool, error)\n```\nBuildKitEnabled on the fake cli\n\n```go\nfunc (c *FakeCli) Client() client.APIClient\n```\nClient returns a docker API client\n\n```go\nfunc (c *FakeCli) ConfigFile() *configfile.ConfigFile\n```\nConfigFile returns the cli configfile object (to get client configuration)\n\n```go\nfunc (c *FakeCli) ContentTrustEnabled() bool\n```\nContentTrustEnabled on the fake cli\n\n```go\nfunc (c *FakeCli) ContextStore() store.Store\n```\nContextStore returns the cli context store\n\n```go\nfunc (c *FakeCli) CurrentContext() string\n```\nCurrentContext returns the cli context\n\n```go\nfunc (c *FakeCli) CurrentVersion() string\n```\nCurrentVersion returns the API version used by FakeCli.\n\n```go\nfunc (c *FakeCli) DockerEndpoint() docker.Endpoint\n```\nDockerEndpoint returns the current DockerEndpoint\n\n```go\nfunc (c *FakeCli) Err() *streams.Out\n```\nErr returns the output stream (stderr) the cli should write on\n\n```go\nfunc (c *FakeCli) ErrBuffer() *bytes.Buffer\n```\nErrBuffer Buffer returns the stderr buffer\n\n```go\nfunc (c *FakeCli) In() *streams.In\n```\nIn returns the input stream the cli will use\n\n```go\nfunc (c *FakeCli) ManifestStore() manifeststore.Store\n```\nManifestStore returns a fake store used for testing\n\n```go\nfunc (c *FakeCli) NotaryClient(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (notaryclient.Repository, error)\n```\nNotaryClient returns an err for testing unless defined\n\n```go\nfunc (c *FakeCli) Out() *streams.Out\n```\nOut returns the output stream (stdout) the cli should write on\n\n```go\nfunc (c *FakeCli) OutBuffer() *bytes.Buffer\n```\nOutBuffer returns the stdout buffer\n\n```go\nfunc (c *FakeCli) RegistryClient(bool) registryclient.RegistryClient\n```\nRegistryClient returns a fake client for testing\n\n```go\nfunc (c *FakeCli) ResetOutputBuffers()\n```\nResetOutputBuffers resets the .OutBuffer() and.ErrBuffer() back to empty\n\n```go\nfunc (c *FakeCli) ServerInfo() command.ServerInfo\n```\nServerInfo returns API server information for the server used by this client\n\n```go\nfunc (c *FakeCli) SetConfigFile(configFile *configfile.ConfigFile)\n```\nSetConfigFile sets the \"fake\" config file\n\n```go\nfunc (c *FakeCli) SetContextStore(contextStore store.Store)\n```\nSetContextStore sets the \"fake\" context store\n\n```go\nfunc (c *FakeCli) SetCurrentContext(name string)\n```\nSetCurrentContext sets the \"fake\" current context\n\n```go\nfunc (c *FakeCli) SetDockerEndpoint(ep docker.Endpoint)\n```\nSetDockerEndpoint sets the \"fake\" docker endpoint\n\n```go\nfunc (c *FakeCli) SetErr(err *streams.Out)\n```\nSetErr sets the stderr stream for the cli to the specified io.Writer\n\n```go\nfunc (c *FakeCli) SetIn(in *streams.In)\n```\nSetIn sets the input of the cli to the specified ReadCloser\n\n```go\nfunc (c *FakeCli) SetManifestStore(manifestStore manifeststore.Store)\n```\nSetManifestStore on the fake cli\n\n```go\nfunc (c *FakeCli) SetNotaryClient(notaryClientFunc NotaryClientFuncType)\n```\nSetNotaryClient sets the internal getter for retrieving a NotaryClient\n\n```go\nfunc (c *FakeCli) SetOut(out *streams.Out)\n```\nSetOut sets the stdout stream for the cli to the specified io.Writer\n\n```go\nfunc (c *FakeCli) SetRegistryClient(registryClient registryclient.RegistryClient)\n```\nSetRegistryClient on the fake cli\n\n```go\ntype FakeStore struct {\n\t// contains filtered or unexported fields\n}\n```\nFakeStore implements a credentials.Store that only acts as an in memory map\n\n```go\nfunc (c *FakeStore) Erase(serverAddress string) error\n```\nErase removes the given credentials from the map store\n\n```go\nfunc (c *FakeStore) Get(serverAddress string) (types.AuthConfig, error)\n```\nGet retrieves credentials for a specific server from the map store.\n\n```go\nfunc (c *FakeStore) GetAll() (map[string]types.AuthConfig, error)\n```\nGetAll returns the key value pairs of ServerAddress =\u003e Username\n\n```go\nfunc (c *FakeStore) SetEraseFunc(eraseFunc func(string) error)\n```\nSetEraseFunc is used to overrides Erase function\n\n```go\nfunc (c *FakeStore) SetGetAllFunc(getAllFunc func() (map[string]types.AuthConfig, error))\n```\nSetGetAllFunc is used to  overrides GetAll function\n\n```go\nfunc (c *FakeStore) SetGetFunc(getFunc func(string) (types.AuthConfig, error))\n```\nSetGetFunc is used to overrides Get function\n\n```go\nfunc (c *FakeStore) SetStore(store map[string]types.AuthConfig)\n```\nSetStore is used to overrides Set function\n\n```go\nfunc (c *FakeStore) SetStoreFunc(storeFunc func(types.AuthConfig) error)\n```\nSetStoreFunc is used to override Store function\n\n```go\nfunc (c *FakeStore) Store(authConfig types.AuthConfig) error\n```\nStore saves the given credentials in the map store.\n\n```go\ntype NotaryClientFuncType func(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (notaryclient.Repository, error)\n```\nNotaryClientFuncType defines a function that returns a fake notary client\n\n","path":"github.1git.de/docker/cli/internal/test","name":"test","synopsis":"Package test is a test-only package that can be used by other cli package to write unit test.","isRedistributable":true}
