Documentation ¶
Index ¶
- type BuildArgs
- type BuildContext
- type BuildForceRemove
- type BuildOpt
- type BuildPullParent
- type BuildRemove
- type BuildTags
- type FileContents
- type PathContents
- type RunCmdOpt
- type RunCmdUser
- type RunOptions
- type Runner
- func (d *Runner) BuildImage(ctx context.Context, containerfile string, containerContext BuildContext, ...) ([]byte, error)
- func (d *Runner) CopyFrom(container string, source string) (BuildContext, *types.ContainerPathStat, error)
- func (d *Runner) CopyTo(container string, destination string, contents BuildContext) error
- func (d *Runner) GetNetworkAndAddresses(container string) (map[string]string, error)
- func (d *Runner) Restart(ctx context.Context, containerID string) error
- func (d *Runner) RunCmdInBackground(ctx context.Context, container string, cmd []string, opts ...RunCmdOpt) (string, error)
- func (d *Runner) RunCmdWithOutput(ctx context.Context, container string, cmd []string, opts ...RunCmdOpt) ([]byte, []byte, int, error)
- func (d *Runner) Start(ctx context.Context, addSuffix, forceLocalAddr bool) (*types.ContainerJSON, []string, string, error)
- func (d *Runner) StartNewService(ctx context.Context, addSuffix, forceLocalAddr bool, connect ServiceAdapter) (*Service, string, error)
- func (d *Runner) StartService(ctx context.Context, connect ServiceAdapter) (*Service, error)
- func (d *Runner) Stop(ctx context.Context, containerID string) error
- type Service
- type ServiceAdapter
- type ServiceConfig
- type ServiceHostPort
- type ServiceURL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildContext ¶ added in v1.13.0
type BuildContext map[string]PathContents
func BuildContextFromTarball ¶ added in v1.13.0
func BuildContextFromTarball(reader io.Reader) (BuildContext, error)
func NewBuildContext ¶ added in v1.13.0
func NewBuildContext() BuildContext
type BuildForceRemove ¶ added in v1.13.0
type BuildForceRemove bool
func (BuildForceRemove) Apply ¶ added in v1.13.0
func (u BuildForceRemove) Apply(cfg *types.ImageBuildOptions) error
type BuildOpt ¶ added in v1.13.0
type BuildOpt interface {
Apply(cfg *types.ImageBuildOptions) error
}
type BuildPullParent ¶ added in v1.13.0
type BuildPullParent bool
func (BuildPullParent) Apply ¶ added in v1.13.0
func (u BuildPullParent) Apply(cfg *types.ImageBuildOptions) error
type BuildRemove ¶ added in v1.13.0
type BuildRemove bool
func (BuildRemove) Apply ¶ added in v1.13.0
func (u BuildRemove) Apply(cfg *types.ImageBuildOptions) error
type FileContents ¶ added in v1.13.0
func (FileContents) Get ¶ added in v1.13.0
func (b FileContents) Get() ([]byte, error)
func (FileContents) UpdateHeader ¶ added in v1.13.0
func (b FileContents) UpdateHeader(header *tar.Header) error
type PathContents ¶ added in v1.13.0
Mapping of path->contents
func PathContentsFromBytes ¶ added in v1.13.0
func PathContentsFromBytes(data []byte) PathContents
func PathContentsFromString ¶ added in v1.13.0
func PathContentsFromString(data string) PathContents
type RunCmdOpt ¶ added in v1.13.0
type RunCmdOpt interface {
Apply(cfg *types.ExecConfig) error
}
type RunCmdUser ¶ added in v1.13.0
type RunCmdUser string
func (RunCmdUser) Apply ¶ added in v1.13.0
func (u RunCmdUser) Apply(cfg *types.ExecConfig) error
type RunOptions ¶ added in v1.6.0
type Runner ¶ added in v1.6.0
type Runner struct { DockerAPI *client.Client RunOptions RunOptions }
func NewServiceRunner ¶ added in v1.6.0
func NewServiceRunner(opts RunOptions) (*Runner, error)
func (*Runner) BuildImage ¶ added in v1.13.0
func (*Runner) CopyFrom ¶ added in v1.13.0
func (d *Runner) CopyFrom(container string, source string) (BuildContext, *types.ContainerPathStat, error)
func (*Runner) CopyTo ¶ added in v1.13.0
func (d *Runner) CopyTo(container string, destination string, contents BuildContext) error
func (*Runner) GetNetworkAndAddresses ¶ added in v1.13.0
func (*Runner) RunCmdInBackground ¶ added in v1.13.0
func (*Runner) RunCmdWithOutput ¶ added in v1.13.0
func (*Runner) StartNewService ¶ added in v1.13.0
func (d *Runner) StartNewService(ctx context.Context, addSuffix, forceLocalAddr bool, connect ServiceAdapter) (*Service, string, error)
StartNewService will start the runner's configured docker container but with the ability to control adding a name suffix or forcing a local address to be returned. 'addSuffix' will add a random UUID to the end of the container name. 'forceLocalAddr' will force the container address returned to be in the form of '127.0.0.1:1234' where 1234 is the mapped container port.
func (*Runner) StartService ¶ added in v1.6.0
StartService will start the runner's configured docker container with a random UUID suffix appended to the name to make it unique and will return either a hostname or local address depending on if a Docker network was given.
Most tests can default to using this.
type Service ¶ added in v1.6.0
type Service struct { Config ServiceConfig Cleanup func() Container *types.ContainerJSON }
type ServiceAdapter ¶ added in v1.6.0
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 ¶ added in v1.6.0
type ServiceHostPort ¶ added in v1.6.0
type ServiceHostPort struct {
// contains filtered or unexported fields
}
func NewServiceHostPort ¶ added in v1.6.0
func NewServiceHostPort(host string, port int) *ServiceHostPort
func NewServiceHostPortParse ¶ added in v1.6.0
func NewServiceHostPortParse(s string) (*ServiceHostPort, error)
func (ServiceHostPort) Address ¶ added in v1.6.0
func (s ServiceHostPort) Address() string
func (ServiceHostPort) URL ¶ added in v1.6.0
func (s ServiceHostPort) URL() *url.URL
type ServiceURL ¶ added in v1.6.0
type ServiceURL struct {
// contains filtered or unexported fields
}
func NewServiceURL ¶ added in v1.6.0
func NewServiceURL(u url.URL) *ServiceURL
func NewServiceURLParse ¶ added in v1.6.0
func NewServiceURLParse(s string) (*ServiceURL, error)
func (ServiceURL) Address ¶ added in v1.6.0
func (s ServiceURL) Address() string
func (ServiceURL) URL ¶ added in v1.6.0
func (s ServiceURL) URL() *url.URL