Documentation
¶
Index ¶
- type ContainerConfig
- type ImagePullProgress
- type LogStreamOptions
- type RuntimeContainer
- func (rc *RuntimeContainer) CheckAvailability(ctx context.Context) error
- func (rc *RuntimeContainer) CleanupStale(ctx context.Context, containerName string) error
- func (rc *RuntimeContainer) CreateAndStart(ctx context.Context, cfg *ContainerConfig) (string, error)
- func (rc *RuntimeContainer) EnsureImage(ctx context.Context, img string, progress chan<- ImagePullProgress) error
- func (rc *RuntimeContainer) IsRunning(ctx context.Context, containerID string) (bool, error)
- func (rc *RuntimeContainer) RestartContainer(ctx context.Context, containerID string) error
- func (rc *RuntimeContainer) Stop(ctx context.Context, containerID string) error
- func (rc *RuntimeContainer) StreamLogs(ctx context.Context, containerID string) (io.ReadCloser, error)
- func (rc *RuntimeContainer) StreamLogsWithOptions(ctx context.Context, containerID string, opts LogStreamOptions) (io.ReadCloser, error)
- type RuntimeContainerManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerConfig ¶
type ContainerConfig struct {
Image string
ContainerName string
Cmd []string
HostPort string
ContainerPort string
AppDir string
EnvVars map[string]string
Binds []string
NetworkName string
}
ContainerConfig holds the configuration for creating a runtime container.
type ImagePullProgress ¶
ImagePullProgress reports progress of a Docker image pull operation.
type LogStreamOptions ¶
type LogStreamOptions struct {
Follow bool
Tail string // "all" or a number like "100"
Since string // RFC3339 timestamp or relative duration
Timestamps bool
}
LogStreamOptions configures container log streaming with filtering support.
type RuntimeContainer ¶
type RuntimeContainer struct {
// contains filtered or unexported fields
}
RuntimeContainer implements RuntimeContainerManager using the Docker Engine API.
func NewRuntimeContainer ¶
func NewRuntimeContainer(logger *zap.Logger) (*RuntimeContainer, error)
NewRuntimeContainer creates a new Docker client for managing runtime containers.
func (*RuntimeContainer) CheckAvailability ¶
func (rc *RuntimeContainer) CheckAvailability(ctx context.Context) error
func (*RuntimeContainer) CleanupStale ¶
func (rc *RuntimeContainer) CleanupStale( ctx context.Context, containerName string, ) error
func (*RuntimeContainer) CreateAndStart ¶
func (rc *RuntimeContainer) CreateAndStart( ctx context.Context, cfg *ContainerConfig, ) (string, error)
func (*RuntimeContainer) EnsureImage ¶
func (rc *RuntimeContainer) EnsureImage( ctx context.Context, img string, progress chan<- ImagePullProgress, ) error
func (*RuntimeContainer) RestartContainer ¶
func (rc *RuntimeContainer) RestartContainer( ctx context.Context, containerID string, ) error
func (*RuntimeContainer) Stop ¶
func (rc *RuntimeContainer) Stop(ctx context.Context, containerID string) error
func (*RuntimeContainer) StreamLogs ¶
func (rc *RuntimeContainer) StreamLogs( ctx context.Context, containerID string, ) (io.ReadCloser, error)
func (*RuntimeContainer) StreamLogsWithOptions ¶
func (rc *RuntimeContainer) StreamLogsWithOptions( ctx context.Context, containerID string, opts LogStreamOptions, ) (io.ReadCloser, error)
type RuntimeContainerManager ¶
type RuntimeContainerManager interface {
CheckAvailability(ctx context.Context) error
EnsureImage(ctx context.Context, image string, progress chan<- ImagePullProgress) error
CreateAndStart(ctx context.Context, config *ContainerConfig) (string, error)
StreamLogs(ctx context.Context, containerID string) (io.ReadCloser, error)
StreamLogsWithOptions(ctx context.Context, containerID string, opts LogStreamOptions) (io.ReadCloser, error)
RestartContainer(ctx context.Context, containerID string) error
Stop(ctx context.Context, containerID string) error
IsRunning(ctx context.Context, containerID string) (bool, error)
CleanupStale(ctx context.Context, containerName string) error
}
RuntimeContainerManager manages Docker containers for the Celerity dev runtime.
Click to show internal directories.
Click to hide internal directories.