cont

package
v3.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2021 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package cont provides tools to manage service containers started by Database Lab Engine.

Index

Constants

View Source
const (

	// StopTimeout defines a container stop timeout.
	StopTimeout = 30 * time.Second

	// StopPhysicalTimeout defines stop timeout for a physical container.
	StopPhysicalTimeout = 5 * time.Second

	// SyncInstanceContainerPrefix defines a sync container name.
	SyncInstanceContainerPrefix = "dblab_sync_"

	// DBLabControlLabel defines a label to mark service containers.
	DBLabControlLabel = "dblab_control"
	// DBLabSatelliteLabel defines a label to mark satellite containers.
	DBLabSatelliteLabel = "dblab_satellite"
	// DBLabInstanceIDLabel defines a label to mark service containers related to the current Database Lab instance.
	DBLabInstanceIDLabel = "dblab_instance_id"
	// DBLabEngineNameLabel defines the label value providing the container name of the current Database Lab instance.
	DBLabEngineNameLabel = "dblab_engine_name"

	// DBLabSyncLabel defines a label value for sync containers.
	DBLabSyncLabel = "dblab_sync"
	// DBLabPromoteLabel defines a label value for promote containers.
	DBLabPromoteLabel = "dblab_promote"
	// DBLabPatchLabel defines a label value for patch containers.
	DBLabPatchLabel = "dblab_patch"
	// DBLabDumpLabel defines a label value for dump containers.
	DBLabDumpLabel = "dblab_dump"
	// DBLabRestoreLabel defines a label value for restore containers.
	DBLabRestoreLabel = "dblab_restore"
	// DBLabEmbeddedUILabel defines a label value for embedded UI containers.
	DBLabEmbeddedUILabel = "dblab_embedded_ui"

	// DBLabRunner defines a label to mark runner containers.
	DBLabRunner = "dblab_runner"
)

Variables

This section is empty.

Functions

func BuildHostConfig

func BuildHostConfig(ctx context.Context, docker *client.Client, dataDir string,
	contConf map[string]interface{}) (*container.HostConfig, error)

BuildHostConfig builds host config.

func CleanUpControlContainers

func CleanUpControlContainers(ctx context.Context, dockerClient *client.Client, instanceID string) error

CleanUpControlContainers removes control containers run by Database Lab Engine.

func CleanUpSatelliteContainers

func CleanUpSatelliteContainers(ctx context.Context, dockerClient *client.Client, instanceID string) error

CleanUpSatelliteContainers removes satellite containers run by Database Lab Engine.

func ResourceOptions

func ResourceOptions(containerConfigs map[string]interface{}) (*container.HostConfig, error)

ResourceOptions parses host config options.

func StopControlContainers

func StopControlContainers(ctx context.Context, dockerClient *client.Client, instanceID, dataDir string) error

StopControlContainers stops control containers run by Database Lab Engine.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL