Documentation ¶
Index ¶
- Constants
- func UserSocketPath() string
- type Connection
- func (c *Connection) CreateContainer(in CreateContainerInput, opts ...CreateContainerOption) (*CreateContainerResult, error)
- func (c *Connection) InspectContainer(name string) (*InspectContainerResult, error)
- func (c *Connection) Ping() error
- func (c *Connection) PullImage(in PullImageInput) error
- func (c *Connection) RemoveContainer(name string) error
- func (c *Connection) StartContainer(name string) error
- func (c *Connection) StopContainer(name string) error
- type CreateContainerInput
- type CreateContainerOption
- type CreateContainerResult
- type Error
- type HTTPDialContext
- type InspectContainerResult
- type PullImageInput
- type RequestOption
Constants ¶
View Source
const ( ImagePullPolicyAlways = `always` ImagePullPolicyMissing = `missing` ImagePullPolicyNewer = `newer` ImagePullPolicyNever = `never` )
Variables ¶
This section is empty.
Functions ¶
func UserSocketPath ¶
func UserSocketPath() string
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func New ¶
func New(socketPath string) (*Connection, error)
func (*Connection) CreateContainer ¶
func (c *Connection) CreateContainer(in CreateContainerInput, opts ...CreateContainerOption) (*CreateContainerResult, error)
func (*Connection) InspectContainer ¶
func (c *Connection) InspectContainer(name string) (*InspectContainerResult, error)
func (*Connection) Ping ¶
func (c *Connection) Ping() error
func (*Connection) PullImage ¶
func (c *Connection) PullImage(in PullImageInput) error
func (*Connection) RemoveContainer ¶
func (c *Connection) RemoveContainer(name string) error
func (*Connection) StartContainer ¶
func (c *Connection) StartContainer(name string) error
func (*Connection) StopContainer ¶
func (c *Connection) StopContainer(name string) error
type CreateContainerInput ¶
type CreateContainerInput struct { Name string `json:"name,omitempty"` Image string `json:"image,omitempty"` PublishImagePorts bool `json:"publish_image_ports,omitempty"` Remove bool `json:"remove,omitempty"` TimeoutSeconds uint `json:"timeout,omitempty"` Env map[string]string `json:"env,omitempty"` }
type CreateContainerOption ¶
type CreateContainerOption func(*CreateContainerInput)
func WithEnv ¶
func WithEnv(name, value string) CreateContainerOption
type CreateContainerResult ¶
type Error ¶
type HTTPDialContext ¶
type InspectContainerResult ¶
type InspectContainerResult struct { ID string `json:"Id"` NetworkSettings struct { Ports map[string][]struct { HostIP string `json:"hostIp"` HostPort string `json:"hostPort"` } `json:"Ports"` } `json:"NetworkSettings"` }
func StartDevcontainer ¶
func StartDevcontainer(ctx context.Context, conn *Connection, name string, image string, opts ...CreateContainerOption) (*InspectContainerResult, error)
func (InspectContainerResult) TCPHostPort ¶
func (r InspectContainerResult) TCPHostPort(port int) string
type PullImageInput ¶
type RequestOption ¶
func RequestJSONBody ¶
func RequestJSONBody(data any) RequestOption
func RequestMethod ¶
func RequestMethod(m string) RequestOption
func RequestPath ¶
func RequestPath(path string, a ...any) RequestOption
func RequestQueryStruct ¶
func RequestQueryStruct(data any) RequestOption
Click to show internal directories.
Click to hide internal directories.