docker

package
v0.0.0-...-a0f6db5 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RunOptions

type RunOptions struct {
	ImageRepo       string
	ImageTag        string
	ContainerName   string
	Cmd             []string
	Entrypoint      []string
	Env             []string
	NetworkID       string
	CopyFromTo      map[string]string
	Ports           []string
	DoNotAutoRemove bool
	AuthUsername    string
	AuthPassword    string
	LogConsumer     func(string)
}

type Runner

type Runner struct {
	DockerAPI  *client.Client
	RunOptions RunOptions
}

func NewServiceRunner

func NewServiceRunner(opts RunOptions) (*Runner, error)

func (*Runner) Start

func (d *Runner) Start(ctx context.Context) (*types.ContainerJSON, []string, error)

func (*Runner) StartService

func (d *Runner) StartService(ctx context.Context, connect ServiceAdapter) (*Service, error)

type Service

type Service struct {
	Config    ServiceConfig
	Cleanup   func()
	Container *types.ContainerJSON
}

type ServiceAdapter

type ServiceAdapter func(ctx context.Context, host string, port int) (ServiceConfig, error)

ServiceAdapter verifies connectivity to the service, then returns either the connection string (typically a URL) and nil, or empty string and an error.

type ServiceConfig

type ServiceConfig interface {
	Address() string
	URL() *url.URL
}

type ServiceHostPort

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

func NewServiceHostPort

func NewServiceHostPort(host string, port int) *ServiceHostPort

func NewServiceHostPortParse

func NewServiceHostPortParse(s string) (*ServiceHostPort, error)

func (ServiceHostPort) Address

func (s ServiceHostPort) Address() string

func (ServiceHostPort) URL

func (s ServiceHostPort) URL() *url.URL

type ServiceURL

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

func NewServiceURL

func NewServiceURL(u url.URL) *ServiceURL

func NewServiceURLParse

func NewServiceURLParse(s string) (*ServiceURL, error)

func (ServiceURL) Address

func (s ServiceURL) Address() string

func (ServiceURL) URL

func (s ServiceURL) URL() *url.URL

Jump to

Keyboard shortcuts

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