internal

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEventStreamClosed = errors.New("event stream closed")

Functions

func ArchiveVolume

func ArchiveVolume(ctx context.Context, volumeNames []string, targetFile string) error

func ContainerID

func ContainerID() string

func CreateNetworkIfNeeded

func CreateNetworkIfNeeded(ctx context.Context, name string) (string, error)

func JoinNetwork

func JoinNetwork(ctx context.Context, containerID string, networkID string) error

func LoggerFromContext

func LoggerFromContext(ctx context.Context) *zap.Logger

func ReadEnvFile added in v0.0.3

func ReadEnvFile(filename string) (map[string]string, error)

func SetFlags

func SetFlags(cmd *exec.Cmd)

Set parent group and death signal to be sure that nested processes will be closed

func StreamingLogger

func StreamingLogger(logger *zap.Logger) io.WriteCloser

func SubLogger

func SubLogger(ctx context.Context, name string) *zap.Logger

func ToDomain

func ToDomain(file string) string

func UnArchiveVolume

func UnArchiveVolume(ctx context.Context, volumeNames []string, targetFile string) error

func WaitToBeHealthy added in v0.0.3

func WaitToBeHealthy(ctx context.Context, cli client.APIClient, containerID string, created string) error

func WithLogger

func WithLogger(ctx context.Context, logger *zap.Logger) context.Context

func WithSubLogger added in v0.0.3

func WithSubLogger(ctx context.Context, name string) context.Context

Types

type At

type At string

func In

func In(directory string) At

func (At) Do

func (inv At) Do(ctx context.Context, binary string, args ...string) *Process

type ErrDockerAPI

type ErrDockerAPI struct {
	Message string
}

func (*ErrDockerAPI) Error

func (eda *ErrDockerAPI) Error() string

type Process

type Process struct {
	// contains filtered or unexported fields
}

func (*Process) Env

func (prc *Process) Env(environ map[string]string) *Process

func (*Process) Exec

func (prc *Process) Exec() error

func (*Process) Input added in v0.0.3

func (prc *Process) Input(data []byte) *Process

func (*Process) Output

func (prc *Process) Output() (string, error)

func (*Process) Text

func (prc *Process) Text(data string) *Process

type Task added in v0.0.3

type Task struct {
	// contains filtered or unexported fields
}

func Spawn added in v0.0.3

func Spawn(ctx context.Context, runnable func(ctx context.Context) error) *Task

Spawn background processing go-routine. Will be stopped when context finished or Stop() invoked. Stop will wait till the go-routine finish.

func Timer added in v0.0.3

func Timer(ctx context.Context, interval time.Duration, runnable func(ctx context.Context) error) *Task

Timer task that will be repeated till context canceled (or Stop). Error will be logged.

func (*Task) Error added in v0.0.3

func (bd *Task) Error() error

Error returned by runnable.

func (*Task) Stop added in v0.0.3

func (bd *Task) Stop() error

Stop background context and waits till the end. Returns last error.

func (*Task) Wait added in v0.0.3

func (bd *Task) Wait() <-chan struct{}

Wait for package completion.

Jump to

Keyboard shortcuts

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