container

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: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComposeFinder

type ComposeFinder struct {
	Exec func(ctx context.Context, name string, args ...string) ([]byte, error)
}

func (ComposeFinder) FindAll

Find finds container process by using docker-compose

type ContainerAdapter

type ContainerAdapter struct {
	Finder
	Docker core.Docker
}

func New

func NewWithOpts

func NewWithOpts(fns ...ContainerFn) *ContainerAdapter

func (*ContainerAdapter) Create

Create creates container

func (*ContainerAdapter) Exec

func (*ContainerAdapter) ExecWithOutput

func (c *ContainerAdapter) ExecWithOutput(ctx context.Context, opts core.ContainerExecOptions) ([]byte, error)

ExecWithOutput executes command and returns output

func (*ContainerAdapter) Find

Find finds current docker process and return container id

func (*ContainerAdapter) FindAll

FindAll finds current docker process (including stopped ones) and return container id

func (*ContainerAdapter) Inspect

func (*ContainerAdapter) Start

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

Start starts container

func (*ContainerAdapter) Stop

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

Start starts container

type ContainerFinder

type ContainerFinder struct{}

func (ContainerFinder) FindAll

Find finds container process

type ContainerFn

type ContainerFn func(*ContainerAdapter)

func WithDocker

func WithDocker(d core.Docker) ContainerFn

func WithFinder

func WithFinder(f Finder) ContainerFn

type Finder

type Finder interface {
	FindAll(ctx context.Context, d core.Docker, opts core.ContainerFindOptions) ([]core.Container, error)
}

Jump to

Keyboard shortcuts

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