docker

package
v0.0.0-...-bc664e0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIServerImageEnv    = "VMCLARITY_APISERVER_CONTAINER_IMAGE"
	OrchestratorImageEnv = "VMCLARITY_ORCHESTRATOR_CONTAINER_IMAGE"
	UIImageEnv           = "VMCLARITY_UI_CONTAINER_IMAGE"
	UIBackendImageEnv    = "VMCLARITY_UIBACKEND_CONTAINER_IMAGE"
	ScannerImageEnv      = "VMCLARITY_SCANNER_CONTAINER_IMAGE"
	PluginKicsEnv        = "VMCLARITY_PLUGIN_KICS_CONTAINER_IMAGE"
)
View Source
const (
	ApplicationName = "vmclarity"

	ContainerStateRunning = "running"
	ContainerStateExited  = "exited"
	ContainerStateDead    = "dead"
	ContainerStateHealthy = "healthy"
)

Variables

This section is empty.

Functions

func ProjectFromConfig

func ProjectFromConfig(config *Config) (*types.Project, error)

func WithContainerImages

func WithContainerImages(o *cli.ProjectOptions, images ContainerImages)

Types

type Config

type Config struct {
	// EnvName the name of the environment to be created
	EnvName string `mapstructure:"env_name"`
	// Images used for docker deployment
	Images ContainerImages `mapstructure:",squash"`
	// ComposeFiles contains the list of docker compose files used for deployment
	ComposeFiles []string `mapstructure:"compose_files"`
	// WorkDir absolute path to the directory where the deployment files prior performing actions
	WorkDir string `mapstructure:"work_dir"`
	// SkipAssetInstall defines whether to deploy test assets to environment or not
	SkipAssetInstall bool `mapstructure:"skip_asset_install"`
	// contains filtered or unexported fields
}

type ConfigOptFn

type ConfigOptFn func(*Config) error

ConfigOptFn defines transformer function for Config.

func WithContext

func WithContext(ctx context.Context) ConfigOptFn

func WithWorkDir

func WithWorkDir(dir string) ConfigOptFn

WithWorkDir set workDir for Config.

type ContainerImages

type ContainerImages = envtypes.ContainerImages[string]

type ContextKeyType

type ContextKeyType string
const (
	GatewayServiceName                     = "gateway"
	DockerComposeContextKey ContextKeyType = "DockerCompose"
)

type DockerEnv

type DockerEnv struct {
	// contains filtered or unexported fields
}

func New

func New(config *Config, opts ...ConfigOptFn) (*DockerEnv, error)

func (*DockerEnv) Context

func (e *DockerEnv) Context(ctx context.Context) (context.Context, error)

func (*DockerEnv) Deployments

func (e *DockerEnv) Deployments() []string

func (*DockerEnv) Endpoints

func (e *DockerEnv) Endpoints(_ context.Context) (*envtypes.Endpoints, error)

func (*DockerEnv) ServiceLogs

func (e *DockerEnv) ServiceLogs(ctx context.Context, services []string, startTime time.Time, stdout, stderr io.Writer) error

func (*DockerEnv) Services

func (e *DockerEnv) Services(ctx context.Context) (envtypes.Services, error)

func (*DockerEnv) ServicesReady

func (e *DockerEnv) ServicesReady(ctx context.Context) (bool, error)

func (*DockerEnv) SetUp

func (e *DockerEnv) SetUp(ctx context.Context) error

func (*DockerEnv) TearDown

func (e *DockerEnv) TearDown(ctx context.Context) error

type Service

type Service struct {
	ID          string
	Namespace   string
	Application string
	Component   string
	State       envtypes.ServiceState
}

Service is the types.Service interface implementation.

func (Service) GetApplicationName

func (s Service) GetApplicationName() string

func (Service) GetComponentName

func (s Service) GetComponentName() string

func (Service) GetID

func (s Service) GetID() string

func (Service) GetNamespace

func (s Service) GetNamespace() string

func (Service) GetState

func (s Service) GetState() envtypes.ServiceState

func (Service) String

func (s Service) String() string

type ServiceCollection

type ServiceCollection map[string]*Service

func NewServiceCollectionFromProject

func NewServiceCollectionFromProject(p *types.Project) ServiceCollection

func (ServiceCollection) AsServices

func (c ServiceCollection) AsServices() envtypes.Services

func (ServiceCollection) ServiceNames

func (c ServiceCollection) ServiceNames() []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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