mock

package
v0.0.0-...-c70380f Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClosingBuffer

type ClosingBuffer struct {
	*bytes.Buffer
}

func (*ClosingBuffer) Close

func (cb *ClosingBuffer) Close() (err error)

type DockerClient

type DockerClient struct {
	Platform     string
	Version      string
	ApiVersion   string
	ErrorString  string
	ImagesSlice  []types.ImageSummary
	Stdout       string
	Stderr       string
	ExitCode     int64
	ExitErrorMsg string
	WantChanErr  bool
}

func (*DockerClient) ContainerCreate

func (m *DockerClient) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *specs.Platform, containerName string) (container.ContainerCreateCreatedBody, error)

func (*DockerClient) ContainerLogs

func (m *DockerClient) ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error)

func (*DockerClient) ContainerRemove

func (m *DockerClient) ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error

func (*DockerClient) ContainerStart

func (m *DockerClient) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error

func (*DockerClient) ContainerStop

func (m *DockerClient) ContainerStop(ctx context.Context, container string, timeout *time.Duration) error

func (*DockerClient) ContainerWait

func (m *DockerClient) ContainerWait(ctx context.Context, containerID string, condition container.WaitCondition) (<-chan container.ContainerWaitOKBody, <-chan error)

func (*DockerClient) ImageBuild

func (m *DockerClient) ImageBuild(ctx context.Context, buildContext io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error)

func (*DockerClient) ImageList

func (m *DockerClient) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error)

func (*DockerClient) ImageName

func (m *DockerClient) ImageName(tool *prm.Tool, prmConfig prm.Config) string

func (*DockerClient) ImageRemove

func (m *DockerClient) ImageRemove(ctx context.Context, imageID string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error)

func (*DockerClient) ServerVersion

func (m *DockerClient) ServerVersion(ctx context.Context) (types.Version, error)

type MockBackend

type MockBackend struct {
	StatusIsAvailable   bool
	StatusMessageString string
	ToolAvalible        bool
	ExecReturn          string
	ValidateReturn      string
}

func (*MockBackend) Exec

func (m *MockBackend) Exec(tool *prm.Tool, args []string, prmConfig prm.Config, paths prm.DirectoryPaths) (prm.ToolExitCode, error)

func (*MockBackend) GetTool

func (m *MockBackend) GetTool(tool *prm.Tool, prmConfig prm.Config) error

func (*MockBackend) Status

func (m *MockBackend) Status() prm.BackendStatus

func (*MockBackend) Validate

func (m *MockBackend) Validate(toolInfo prm.ToolInfo, prmConfig prm.Config, paths prm.DirectoryPaths) (prm.ValidateExitCode, string, error)

Implement when needed

type PctInstaller

type PctInstaller struct {
	ExpectedToolPkg   string
	ExpectedTargetDir string
	ExpectedGitUri    string
}

func (*PctInstaller) Install

func (p *PctInstaller) Install(templatePkg, targetDir string, force bool) (string, error)

func (*PctInstaller) InstallClone

func (p *PctInstaller) InstallClone(gitUri, targetDir, tempDir string, force bool) (string, error)

type ReadClose

type ReadClose struct{}

func (*ReadClose) Close

func (re *ReadClose) Close() error

func (*ReadClose) Read

func (re *ReadClose) Read(r []byte) (n int, err error)

type Utils

type Utils struct {
	ExpectedPuppetVer   string
	ExpectedBackendType string
}

func (*Utils) SetAndWriteConfig

func (u *Utils) SetAndWriteConfig(k, v string) error

Jump to

Keyboard shortcuts

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