test

package
v0.0.0-...-d20f30c Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomID

func RandomID() string

RandomID returns a unique, 64-character ID consisting of a-z, 0-9.

Types

type FakeCli

type FakeCli struct {
	command.DockerCli
	// contains filtered or unexported fields
}

FakeCli emulates the default DockerCli

func NewFakeCli

func NewFakeCli(apiClient client.APIClient, opts ...func(*FakeCli)) *FakeCli

NewFakeCli returns a fake for the command.Cli interface

func (*FakeCli) Client

func (c *FakeCli) Client() client.APIClient

Client returns a docker API client

func (*FakeCli) ConfigFile

func (c *FakeCli) ConfigFile() *configfile.ConfigFile

ConfigFile returns the cli configfile object (to get client configuration)

func (*FakeCli) Err

func (c *FakeCli) Err() *streams.Out

Err returns the output stream (stderr) the cli should write on

func (*FakeCli) ErrBuffer

func (c *FakeCli) ErrBuffer() *bytes.Buffer

ErrBuffer Buffer returns the stderr buffer

func (*FakeCli) In

func (c *FakeCli) In() *streams.In

In returns the input stream the cli will use

func (*FakeCli) NotaryClient

func (c *FakeCli) NotaryClient() (notaryclient.Repository, error)

NotaryClient returns an err for testing unless defined

func (*FakeCli) Out

func (c *FakeCli) Out() *streams.Out

Out returns the output stream (stdout) the cli should write on

func (*FakeCli) OutBuffer

func (c *FakeCli) OutBuffer() *bytes.Buffer

OutBuffer returns the stdout buffer

func (*FakeCli) ResetOutputBuffers

func (c *FakeCli) ResetOutputBuffers()

ResetOutputBuffers resets the .OutBuffer() and.ErrBuffer() back to empty

func (*FakeCli) SetErr

func (c *FakeCli) SetErr(err *streams.Out)

SetErr sets the stderr stream for the cli to the specified io.Writer

func (*FakeCli) SetIn

func (c *FakeCli) SetIn(in *streams.In)

SetIn sets the input of the cli to the specified ReadCloser

func (*FakeCli) SetNotaryClient

func (c *FakeCli) SetNotaryClient(notaryClientFunc NotaryClientFuncType)

SetNotaryClient sets the internal getter for retrieving a NotaryClient

func (*FakeCli) SetOut

func (c *FakeCli) SetOut(out *streams.Out)

SetOut sets the stdout stream for the cli to the specified io.Writer

type NotaryClientFuncType

type NotaryClientFuncType func() (notaryclient.Repository, error)

NotaryClientFuncType defines a function that returns a fake notary client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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