Documentation ¶
Index ¶
- func CheckError(t *testing.T, shouldErr bool, err error)
- func CheckErrorAndDeepEqual(t *testing.T, shouldErr bool, err error, expected, actual interface{})
- func CheckErrorAndTypeEquality(t *testing.T, shouldErr bool, err error, expected, actual interface{})
- func ServeFile(t *testing.T, content []byte) (url string, tearDown func())
- func SetEnvs(t *testing.T, envs map[string]string) func(*testing.T)
- func SetupFakeKubernetesContext(t *testing.T, config api.Config) func()
- func TempFile(t *testing.T, prefix string, content []byte) (name string, tearDown func())
- type BadReader
- type BadWriter
- type FakeCmd
- type FakeImageAPIClient
- func (f *FakeImageAPIClient) Close() error
- func (f *FakeImageAPIClient) ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error)
- func (f *FakeImageAPIClient) ImageInspectWithRaw(ctx context.Context, ref string) (types.ImageInspect, []byte, error)
- func (f *FakeImageAPIClient) ImagePush(_ context.Context, _ string, _ types.ImagePushOptions) (io.ReadCloser, error)
- func (f *FakeImageAPIClient) ImageTag(ctx context.Context, image, ref string) error
- func (f *FakeImageAPIClient) Info(ctx context.Context) (types.Info, error)
- type FakeImageAPIOptions
- type FakeReaderCloser
- type TempDir
- func (h *TempDir) Chtimes(file string, t time.Time) *TempDir
- func (h *TempDir) List() ([]string, error)
- func (h *TempDir) Mkdir(dir string) *TempDir
- func (h *TempDir) Path(file string) string
- func (h *TempDir) Remove(file string) *TempDir
- func (h *TempDir) Root() string
- func (h *TempDir) Write(file, content string) *TempDir
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckErrorAndDeepEqual ¶
func ServeFile ¶ added in v0.2.0
ServeFile serves a file with http. Returns the url to the file and a teardown function that should be called to properly stop the server.
func SetEnvs ¶
SetEnvs takes a map of key values to set using os.Setenv and returns a function that can be called to reset the envs to their previous values.
func SetupFakeKubernetesContext ¶ added in v0.9.0
SetupFakeKubernetesContext replaces the current kubernetes configuration file to setup a fixed current context.
Types ¶
type FakeCmd ¶ added in v0.6.0
type FakeCmd struct {
// contains filtered or unexported fields
}
func NewFakeCmd ¶ added in v0.6.0
func NewFakeCmdOut ¶ added in v0.6.0
type FakeImageAPIClient ¶
func NewFakeImageAPIClient ¶
func NewFakeImageAPIClient(initContents map[string]string, opts *FakeImageAPIOptions) *FakeImageAPIClient
func (*FakeImageAPIClient) Close ¶
func (f *FakeImageAPIClient) Close() error
func (*FakeImageAPIClient) ImageBuild ¶
func (f *FakeImageAPIClient) ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error)
func (*FakeImageAPIClient) ImageInspectWithRaw ¶ added in v0.11.0
func (f *FakeImageAPIClient) ImageInspectWithRaw(ctx context.Context, ref string) (types.ImageInspect, []byte, error)
func (*FakeImageAPIClient) ImagePush ¶
func (f *FakeImageAPIClient) ImagePush(_ context.Context, _ string, _ types.ImagePushOptions) (io.ReadCloser, error)
type FakeImageAPIOptions ¶
type FakeReaderCloser ¶
type FakeReaderCloser struct {
Err error
}
func (FakeReaderCloser) Close ¶
func (f FakeReaderCloser) Close() error
type TempDir ¶ added in v0.3.0
type TempDir struct {
// contains filtered or unexported fields
}
TempDir offers actions on a temp directory.
func NewTempDir ¶ added in v0.12.0
NewTempDir creates a temporary directory and a teardown function that should be called to properly delete the directory content.
func (*TempDir) Chtimes ¶ added in v0.12.0
Chtimes changes the times for a file in the temp directory.
Click to show internal directories.
Click to hide internal directories.