Documentation
¶
Index ¶
- Variables
- type CapabilitySpec
- type Client
- func (c *Client) Close() error
- func (c *Client) CreateContainer(ctx context.Context, name string, labels ResourceLabels, spec ContainerSpec) (*Container, error)
- func (c *Client) CreateNetwork(ctx context.Context, labels ResourceLabels, name string, ...) (*Network, error)
- func (c *Client) CreateVolume(ctx context.Context, labels ResourceLabels, name string) (*Volume, error)
- func (c *Client) GetOrCreateLoggingStack(ctx context.Context, scrapeLabels map[string]*string, quiet bool) (*LoggingStack, error)
- func (c *Client) ImportContainer(ctx context.Context, id string) (*Container, error)
- func (c *Client) ImportNetwork(ctx context.Context, id string) (*Network, error)
- func (c *Client) ImportVolume(ctx context.Context, name string) (*Volume, error)
- type Container
- func (c *Container) Client() api.ClientWrapper
- func (c *Container) Connect(ctx context.Context, n *Network, config *network.EndpointSettings) error
- func (c *Container) Disconnect(ctx context.Context, n *Network, force bool) error
- func (c *Container) Exec(ctx context.Context, cmd []string, env map[string]string, workingDir *string, ...) (*stream.MultiplexedStream, error)
- func (c *Container) GetEndpoint(ctx context.Context, network *Network) (*network.EndpointSettings, error)
- func (c *Container) Id() string
- func (c *Container) IsRestartInProgress() bool
- func (c *Container) IsRunning(ctx context.Context) (bool, error)
- func (c *Container) Kill(ctx context.Context, signal string) error
- func (c *Container) Logs(ctx context.Context, follow bool) (*stream.MultiplexedStream, error)
- func (c *Container) Name() string
- func (c *Container) Remove(ctx context.Context, options container.RemoveOptions) error
- func (c *Container) Restart(ctx context.Context, options container.StopOptions) error
- func (c *Container) Start(ctx context.Context, options container.StartOptions) error
- func (c *Container) Stop(ctx context.Context, options container.StopOptions) error
- type ContainerSpec
- type DnsSpec
- type HostPortBinding
- type ImageProvider
- type LoggingStack
- type MountPoint
- type Network
- func (n *Network) Client() api.ClientWrapper
- func (n *Network) Connect(ctx context.Context, container *Container, config *network.EndpointSettings) error
- func (n *Network) Disconnect(ctx context.Context, container *Container, force bool) error
- func (n *Network) HostIP(ctx context.Context) (net.IP, error)
- func (n *Network) Id() string
- func (n *Network) Name() string
- func (n *Network) Remove(ctx context.Context) error
- type Opt
- type PortMapping
- type Protocol
- type ResourceLabels
- type Volume
- func (v *Volume) AddFS(ctx context.Context, fs fs.FS, options container.CopyToContainerOptions) error
- func (v *Volume) AddFiles(ctx context.Context, files map[string]*fstest.MapFile, ...) error
- func (v *Volume) Client() api.ClientWrapper
- func (v *Volume) Name() string
- func (v *Volume) ReadFile(ctx context.Context, path string) (io.ReadCloser, container.PathStat, error)
- func (v *Volume) Remove(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotAttachedToNetwork = errors.New("container is not attached to network")
View Source
var ErrResourceRemoved = errors.New("resource has been removed")
Functions ¶
This section is empty.
Types ¶
type CapabilitySpec ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateContainer ¶
func (c *Client) CreateContainer( ctx context.Context, name string, labels ResourceLabels, spec ContainerSpec, ) (*Container, error)
func (*Client) CreateNetwork ¶
func (c *Client) CreateNetwork( ctx context.Context, labels ResourceLabels, name string, options network.CreateOptions, ) (*Network, error)
func (*Client) CreateVolume ¶
func (*Client) GetOrCreateLoggingStack ¶
func (*Client) ImportContainer ¶
func (*Client) ImportNetwork ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func (*Container) Client ¶
func (c *Container) Client() api.ClientWrapper
func (*Container) Disconnect ¶
func (*Container) GetEndpoint ¶
func (*Container) IsRestartInProgress ¶
type ContainerSpec ¶
type ContainerSpec struct { Labels map[string]string `json:"labels,omitempty"` Image string `json:"image,omitempty"` Command []string `json:"command,omitempty"` Entrypoint []string `json:"entrypoint,omitempty"` WorkingDir string `json:"workingdir,omitempty"` AutoRemove bool `json:"autoremove,omitempty"` Env map[string]string `json:"env,omitempty"` MappedPorts []PortMapping `json:"mappedports,omitempty"` ExposedPorts []nat.Port `json:"exposedports,omitempty"` Networks map[*Network]network.EndpointSettings `json:"networks,omitempty"` Mounts []mount.Mount `json:"mounts,omitempty"` Tty bool `json:"tty,omitempty"` Stdin bool `json:"stdin,omitempty"` Dns DnsSpec `json:"dns,omitempty"` Capabilities CapabilitySpec `json:"capabilities,omitempty"` ExtraHosts []string `json:"extrahosts,omitempty"` HealthCheck *container.HealthConfig `json:"healthcheck,omitempty"` StopSignal string `json:"stopsignal,omitempty"` RestartPolicy container.RestartPolicy `json:"restartpolicy,omitempty"` UsernsMode container.UsernsMode `json:"usernsmode,omitempty"` Privileged bool `json:"privileged,omitempty"` LogConfig container.LogConfig `json:"logconfig,omitempty"` User string `json:"user,omitempty"` }
type HostPortBinding ¶
type ImageProvider ¶
type ImageProvider interface { GetGrafanaImage() string GetLokiImage() string GetAlloyImage() string GetVolumeAccessImage() string }
func DefaultImageProvider ¶
func DefaultImageProvider() ImageProvider
type LoggingStack ¶
type LoggingStack struct {
// contains filtered or unexported fields
}
func (*LoggingStack) Remove ¶
func (l *LoggingStack) Remove(ctx context.Context, options api.DownOptions) error
type MountPoint ¶
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
func (*Network) Client ¶
func (n *Network) Client() api.ClientWrapper
func (*Network) Disconnect ¶
type Opt ¶
func WithImageProvider ¶
func WithImageProvider(imageProvider ImageProvider) Opt
type PortMapping ¶
type PortMapping struct { ContainerPort uint16 `json:"ContainerPort"` Protocol Protocol `json:"Protocol"` HostBindings []HostPortBinding }
type ResourceLabels ¶
Source Files
¶
- client.go
- client_image_provider.go
- client_labels.go
- container.go
- container_exec.go
- container_import.go
- container_lifecycle.go
- container_network.go
- container_new.go
- logging_stack.go
- logging_stack_files.go
- network.go
- network_import.go
- network_lifecycle.go
- network_new.go
- volume.go
- volume_access.go
- volume_import.go
- volume_lifecycle.go
- volume_new.go
- volume_ops.go
Click to show internal directories.
Click to hide internal directories.