Documentation
¶
Index ¶
- func DetectPGVersionFromImage(imageName string) (string, bool)
- type Client
- func (c *Client) CheckImageExists(imageName string) ([]string, bool)
- func (c *Client) CreateContainer(name, version, image string, port int, password string, cpuCores, ramMB int, ...) (string, error)
- func (c *Client) GetContainerLogs(containerID, tail string) (string, error)
- func (c *Client) GetContainerStatus(containerID string) (string, error)
- func (c *Client) GetDockerClient() *client.Client
- func (c *Client) PullImage(imageName string) error
- func (c *Client) RecreateContainer(name, version, image string, port int, password string, cpuCores, ramMB int, ...) (string, error)
- func (c *Client) RemoveContainer(containerID string) error
- func (c *Client) RemoveHelperContainers() (int, error)
- func (c *Client) RemoveVolume(volumeName string) error
- func (c *Client) StartContainer(containerID string) error
- func (c *Client) StopContainer(containerID string) error
- func (c *Client) StreamContainerLogs(ctx context.Context, containerID, tail string, w io.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectPGVersionFromImage ¶
DetectPGVersionFromImage tries to parse the PostgreSQL major version from an image name. Handles:
"postgres:17" → "17" "postgres:17.2" → "17" "pgvector/pgvector:pg18-trixie" → "18" "pgvector/pgvector:0.8.2-pg18" → "18" "postgis/postgis:18-3.6" → "18"
Returns major version string and whether detection succeeded.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CheckImageExists ¶
CheckImageExists checks if a Docker image exists locally and returns its tags
func (*Client) CreateContainer ¶
func (*Client) GetContainerLogs ¶
GetContainerLogs returns the last N lines of logs from a container. Both stdout and stderr are merged into a single string.
func (*Client) GetContainerStatus ¶
func (*Client) GetDockerClient ¶
GetDockerClient returns the underlying Docker client for advanced operations
func (*Client) RecreateContainer ¶
func (c *Client) RecreateContainer(name, version, image string, port int, password string, cpuCores, ramMB int, parameterGroupName string, parameterGroupParams []parameters.Parameter, oldContainerID string) (string, error)
RecreateContainer stops and removes the old container, then creates a new one with the same volume but new parameters
func (*Client) RemoveContainer ¶
func (*Client) RemoveHelperContainers ¶
RemoveHelperContainers force-removes any containers labeled as ODDK helpers (label oddk.helper=true). Called at daemon startup to clean up orphans left by a previous crashed daemon run. Returns the number of containers removed.
Single-host single-daemon deployment is assumed. If a second ODDK daemon is running on the same host, this will rip out its in-flight helper containers.