Documentation
¶
Index ¶
- func NewWriterWithHook(actualWriter io.Writer, hook func([]byte)) *writerWithHook
- func RandomID() string
- func TerminatePrompt(ctx context.Context, t *testing.T, cmd *cobra.Command, cli *FakeCli)
- type FakeCli
- func (c *FakeCli) Client() client.APIClient
- func (c *FakeCli) ConfigFile() *configfile.ConfigFile
- func (c *FakeCli) Err() *streams.Out
- func (c *FakeCli) ErrBuffer() *bytes.Buffer
- func (c *FakeCli) In() *streams.In
- func (c *FakeCli) NotaryClient() (notaryclient.Repository, error)
- func (c *FakeCli) Out() *streams.Out
- func (c *FakeCli) OutBuffer() *bytes.Buffer
- func (c *FakeCli) ResetOutputBuffers()
- func (c *FakeCli) SetErr(err *streams.Out)
- func (c *FakeCli) SetIn(in *streams.In)
- func (c *FakeCli) SetNotaryClient(notaryClientFunc NotaryClientFuncType)
- func (c *FakeCli) SetOut(out *streams.Out)
- type NotaryClientFuncType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWriterWithHook ¶
NewWriterWithHook 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.
Types ¶
type FakeCli ¶
FakeCli emulates the default DockerCli
func NewFakeCli ¶
NewFakeCli returns a fake for the command.Cli interface
func (*FakeCli) ConfigFile ¶
func (c *FakeCli) ConfigFile() *configfile.ConfigFile
ConfigFile returns the cli configfile object (to get client configuration)
func (*FakeCli) NotaryClient ¶
func (c *FakeCli) NotaryClient() (notaryclient.Repository, error)
NotaryClient returns an err for testing unless defined
func (*FakeCli) ResetOutputBuffers ¶
func (c *FakeCli) ResetOutputBuffers()
ResetOutputBuffers resets the .OutBuffer() and.ErrBuffer() back to empty
func (*FakeCli) SetNotaryClient ¶
func (c *FakeCli) SetNotaryClient(notaryClientFunc NotaryClientFuncType)
SetNotaryClient sets the internal getter for retrieving a NotaryClient
type NotaryClientFuncType ¶
type NotaryClientFuncType func() (notaryclient.Repository, error)
NotaryClientFuncType defines a function that returns a fake notary client