mock

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigService

type ConfigService struct {
	CommandFn         func(cmd string, cf *core.Config) *core.CommandConfig
	SaveFn            func(cf *core.Config, opts core.ConfigSaveOptions) error
	CreateAliasFileFn func() (core.Path, error)
	CreateBinFileFn   func(cmd string) (core.Path, error)
}

func NewConfigService

func NewConfigService() *ConfigService

func (*ConfigService) Command

func (c *ConfigService) Command(cmd string, cf *core.Config) *core.CommandConfig

func (*ConfigService) CreateAliasFile

func (c *ConfigService) CreateAliasFile() (core.Path, error)

func (*ConfigService) CreateBinFile

func (c *ConfigService) CreateBinFile(cmd string) (core.Path, error)

func (*ConfigService) Save

func (c *ConfigService) Save(cf *core.Config, opts core.ConfigSaveOptions) error

type ContainerAdapter

type ContainerAdapter struct {
	CreateFn  func(ctx context.Context, options core.ContainerCreateOptions) (core.Container, error)
	StartFn   func(ctx context.Context, ID string) error
	StopFn    func(ctx context.Context, ID string) error
	ExecFn    func(ctx context.Context, options core.ContainerExecOptions) error
	InspectFn func(ctx context.Context, ID string) (core.ContainerInspectResult, error)
	FindFn    func(ctx context.Context, options core.ContainerFindOptions) (core.Container, error)
	FindAllFn func(ctx context.Context, options core.ContainerFindOptions) ([]core.Container, error)
}

func NewContainerAdapter

func NewContainerAdapter(fns ...ContainerFn) *ContainerAdapter

func (*ContainerAdapter) Create

func (*ContainerAdapter) Exec

func (*ContainerAdapter) Find

func (*ContainerAdapter) FindAll

func (*ContainerAdapter) Inspect

func (*ContainerAdapter) Start

func (c *ContainerAdapter) Start(ctx context.Context, ID string) error

func (*ContainerAdapter) Stop

func (c *ContainerAdapter) Stop(ctx context.Context, ID string) error

type ContainerFn

type ContainerFn func(*ContainerAdapter) *ContainerAdapter

func ContainerAdapterWithCreate

func ContainerAdapterWithCreate(ID string) ContainerFn

func ContainerAdapterWithFind

func ContainerAdapterWithFind(ID string) ContainerFn

func ContainerAdapterWithStart

func ContainerAdapterWithStart() ContainerFn

type Docker

type Docker struct {
	ContainerCreateFn      func(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *specs.Platform, containerName string) (container.ContainerCreateCreatedBody, error)
	ContainerStartFn       func(ctx context.Context, cID string, options types.ContainerStartOptions) error
	ContainerStopFn        func(ctx context.Context, containerID string, timeout *time.Duration) error
	ContainerListFn        func(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error)
	ContainerExecCreateFn  func(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error)
	ContainerExecAttachFn  func(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error)
	ContainerExecInspectFn func(ctx context.Context, execID string) (types.ContainerExecInspect, error)
	ContainerWaitFn        func(ctx context.Context, contID string, condition container.WaitCondition) (<-chan container.ContainerWaitOKBody, <-chan error)
	ContainerExecResizeFn  func(ctx context.Context, execID string, options types.ResizeOptions) error
}

func (*Docker) ContainerCreate

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

func (*Docker) ContainerExecAttach

func (d *Docker) ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error)

func (*Docker) ContainerExecCreate

func (d *Docker) ContainerExecCreate(ctx context.Context, id string, config types.ExecConfig) (types.IDResponse, error)

func (*Docker) ContainerExecInspect

func (d *Docker) ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error)

func (*Docker) ContainerExecResize

func (d *Docker) ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error

func (*Docker) ContainerList

func (d *Docker) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error)

func (*Docker) ContainerStart

func (d *Docker) ContainerStart(ctx context.Context, cID string, options types.ContainerStartOptions) error

func (*Docker) ContainerStop

func (d *Docker) ContainerStop(ctx context.Context, cID string, t *time.Duration) error

func (*Docker) ContainerWait

func (d *Docker) ContainerWait(ctx context.Context, contID string, condition container.WaitCondition) (<-chan container.ContainerWaitOKBody, <-chan error)

type ImageAdapter

type ImageAdapter struct {
	FindFn func(ctx context.Context, image string) ([]core.Image, error)
	PullFn func(ctx context.Context, image string) error
}

func NewImageAdapter

func NewImageAdapter(fns ...ImageFn) *ImageAdapter

func (*ImageAdapter) Find

func (i *ImageAdapter) Find(ctx context.Context, image string) ([]core.Image, error)

func (*ImageAdapter) Pull

func (i *ImageAdapter) Pull(ctx context.Context, image string) error

type ImageFn

type ImageFn func(*ImageAdapter) *ImageAdapter

func ImageAdapterWithFind

func ImageAdapterWithFind(image string) ImageFn

func ImageAdapterWithPull

func ImageAdapterWithPull(image string) ImageFn

type Nothing

type Nothing struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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