service

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricIDContainerStatus = "vertex_container_status"
	MetricIDContainersCount = "vertex_containers_count"
)

Variables

View Source
var (
	ErrContainerAlreadyExists     = errors.New("container already exists")
	ErrContainerAlreadyRunning    = errors.New("the container is already running")
	ErrContainerNotRunning        = errors.New("the container is not running")
	ErrInstallMethodDoesNotExists = errors.New("this install method doesn't exist for this service")
)

Functions

func NewContainerEnvService

func NewContainerEnvService(adapter port.ContainerEnvAdapter) port.ContainerEnvService

func NewContainerLogsService

func NewContainerLogsService(ctx *app.Context, adapter port.ContainerLogsAdapter) port.ContainerLogsService

func NewContainerRunnerService

func NewContainerRunnerService(ctx *app.Context, adapter port.ContainerRunnerAdapter) port.ContainerRunnerService

func NewContainerService

func NewContainerService(params ContainerServiceParams) port.ContainerService

func NewDockerKernelService

func NewDockerKernelService(dockerAdapter port.DockerAdapter) port.DockerService

func NewMetricsService

func NewMetricsService(ctx *apptypes.Context) port.MetricsService

Types

type ContainerEnvService

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

func (*ContainerEnvService) Load

func (s *ContainerEnvService) Load(inst *types.Container) error

func (*ContainerEnvService) Save

type ContainerLogsService

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

func (*ContainerLogsService) GetLatestLogs

func (s *ContainerLogsService) GetLatestLogs(uuid uuid.UUID) ([]types.LogLine, error)

func (*ContainerLogsService) GetUUID

func (s *ContainerLogsService) GetUUID() uuid.UUID

func (*ContainerLogsService) OnEvent

func (s *ContainerLogsService) OnEvent(e event.Event) error

type ContainerRunnerService

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

func (*ContainerRunnerService) CheckForUpdates

func (s *ContainerRunnerService) CheckForUpdates(inst *types.Container) error

func (*ContainerRunnerService) Delete

func (s *ContainerRunnerService) Delete(inst *types.Container) error

func (*ContainerRunnerService) GetAllVersions

func (s *ContainerRunnerService) GetAllVersions(inst *types.Container, useCache bool) ([]string, error)

func (*ContainerRunnerService) GetDockerContainerInfo

func (s *ContainerRunnerService) GetDockerContainerInfo(inst types.Container) (map[string]any, error)

func (*ContainerRunnerService) Install

func (s *ContainerRunnerService) Install(uuid uuid.UUID, service types.Service) error

func (*ContainerRunnerService) RecreateContainer

func (s *ContainerRunnerService) RecreateContainer(inst *types.Container) error

RecreateContainer recreates a container by its UUID.

func (*ContainerRunnerService) Start

func (s *ContainerRunnerService) Start(inst *types.Container) error

Start starts a container by its UUID. If the container does not exist, it returns ErrContainerNotFound. If the container is already running, it returns ErrContainerAlreadyRunning.

func (*ContainerRunnerService) Stop

Stop stops a container by its UUID. If the container does not exist, it returns ErrContainerNotFound. If the container is not running, it returns ErrContainerNotRunning.

func (*ContainerRunnerService) WaitStatus added in v0.16.0

func (s *ContainerRunnerService) WaitStatus(inst *types.Container, status string) error

type ContainerService

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

func (*ContainerService) CheckForUpdates

func (s *ContainerService) CheckForUpdates() (map[uuid.UUID]*types.Container, error)

func (*ContainerService) Delete

func (s *ContainerService) Delete(inst *types.Container) error

Delete deletes a container by its UUID. If the container is still running, it returns ErrContainerStillRunning.

func (*ContainerService) DeleteAll

func (s *ContainerService) DeleteAll()

func (*ContainerService) Exists

func (s *ContainerService) Exists(uuid uuid.UUID) bool

func (*ContainerService) Get

func (s *ContainerService) Get(uuid uuid.UUID) (*types.Container, error)

func (*ContainerService) GetAll

func (s *ContainerService) GetAll() map[uuid.UUID]*types.Container

func (*ContainerService) GetTags

func (s *ContainerService) GetTags() []string

func (*ContainerService) GetUUID

func (s *ContainerService) GetUUID() uuid.UUID

func (*ContainerService) Install

func (s *ContainerService) Install(service types.Service, method string) (*types.Container, error)

func (*ContainerService) LoadAll

func (s *ContainerService) LoadAll()

func (*ContainerService) OnEvent

func (s *ContainerService) OnEvent(e event.Event) error

func (*ContainerService) Search

Search returns all containers that match the query.

func (*ContainerService) SetDatabases

func (s *ContainerService) SetDatabases(inst *types.Container, databases map[string]uuid.UUID, options map[string]*types.SetDatabasesOptions) error

func (*ContainerService) StartAll

func (s *ContainerService) StartAll()

func (*ContainerService) StopAll

func (s *ContainerService) StopAll()

type ContainerServiceParams

type ContainerServiceParams struct {
	Ctx *app.Context

	ContainerAdapter port.ContainerAdapter

	ContainerRunnerService   port.ContainerRunnerService
	ContainerServiceService  port.ContainerServiceService
	ContainerEnvService      port.ContainerEnvService
	ContainerSettingsService port.ContainerSettingsService
	ServiceService           port.ServiceService
}

type ContainerServiceService

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

func (*ContainerServiceService) CheckForUpdate

func (s *ContainerServiceService) CheckForUpdate(inst *types.Container, latest types.Service) error

CheckForUpdate checks if the service of a container has an update. If it has, it sets the container's ServiceUpdate field.

func (*ContainerServiceService) Load

func (*ContainerServiceService) Save

func (s *ContainerServiceService) Save(inst *types.Container, service types.Service) error

func (*ContainerServiceService) Update

func (s *ContainerServiceService) Update(inst *types.Container, service types.Service) error

Update updates the service of a container. The service passed is the latest version of the service.

type ContainerSettingsService

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

func NewContainerSettingsService

func NewContainerSettingsService(adapter port.ContainerSettingsAdapter) *ContainerSettingsService

func (*ContainerSettingsService) Load

func (*ContainerSettingsService) Save

func (*ContainerSettingsService) SetDatabases

func (s *ContainerSettingsService) SetDatabases(inst *types.Container, databases map[string]uuid.UUID) error

func (*ContainerSettingsService) SetDisplayName

func (s *ContainerSettingsService) SetDisplayName(inst *types.Container, value string) error

func (*ContainerSettingsService) SetLaunchOnStartup

func (s *ContainerSettingsService) SetLaunchOnStartup(inst *types.Container, value bool) error

func (*ContainerSettingsService) SetTags

func (s *ContainerSettingsService) SetTags(inst *types.Container, tags []string) error

func (*ContainerSettingsService) SetVersion

func (s *ContainerSettingsService) SetVersion(inst *types.Container, value string) error

type DockerKernelService

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

func (DockerKernelService) BuildImage

func (DockerKernelService) CreateContainer

func (DockerKernelService) DeleteContainer

func (s DockerKernelService) DeleteContainer(id string) error

func (DockerKernelService) DeleteMounts added in v0.15.0

func (s DockerKernelService) DeleteMounts(uuid string) error

func (DockerKernelService) InfoContainer

func (DockerKernelService) InfoImage

func (DockerKernelService) ListContainers

func (s DockerKernelService) ListContainers() ([]types.DockerContainer, error)

func (DockerKernelService) LogsStderrContainer

func (s DockerKernelService) LogsStderrContainer(id string) (io.ReadCloser, error)

func (DockerKernelService) LogsStdoutContainer

func (s DockerKernelService) LogsStdoutContainer(id string) (io.ReadCloser, error)

func (DockerKernelService) PullImage

func (s DockerKernelService) PullImage(options types.PullImageOptions) (io.ReadCloser, error)

func (DockerKernelService) StartContainer

func (s DockerKernelService) StartContainer(id string) error

func (DockerKernelService) StopContainer

func (s DockerKernelService) StopContainer(id string) error

func (DockerKernelService) WaitContainer

func (s DockerKernelService) WaitContainer(id string, cond types.WaitContainerCondition) error

type MetricsService

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

func (*MetricsService) GetUUID

func (s *MetricsService) GetUUID() uuid.UUID

func (*MetricsService) OnEvent

func (s *MetricsService) OnEvent(e event.Event) error

type ServiceService

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

func NewServiceService

func NewServiceService() *ServiceService

func (*ServiceService) GetAll

func (s *ServiceService) GetAll() []types.Service

func (*ServiceService) GetById

func (s *ServiceService) GetById(id string) (types.Service, error)

func (*ServiceService) GetUUID

func (s *ServiceService) GetUUID() uuid.UUID

func (*ServiceService) OnEvent

func (s *ServiceService) OnEvent(e event.Event) error

Jump to

Keyboard shortcuts

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