service

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

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

This section is empty.

Types

type ContainerEnvService

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

func NewContainerEnvService

func NewContainerEnvService(adapter types.ContainerEnvAdapterPort) *ContainerEnvService

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 NewContainerLogsService

func NewContainerLogsService(ctx *app.Context, adapter types.ContainerLogsAdapterPort) *ContainerLogsService

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 interface{})

type ContainerRunnerService

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

func NewContainerRunnerService

func NewContainerRunnerService(ctx *app.Context, adapter types.ContainerRunnerAdapterPort) *ContainerRunnerService

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 an container by its UUID. If the container does not exist, it returns ErrContainerNotFound. If the container is not running, it returns ErrContainerNotRunning.

func (*ContainerRunnerService) WaitCondition

type ContainerService

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

func NewContainerService

func NewContainerService(params ContainerServiceParams) *ContainerService

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 an 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)

Get returns an container by its UUID. If the container does not exist, it returns ErrContainerNotFound.

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 interface{})

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) error

func (*ContainerService) StartAll

func (s *ContainerService) StartAll()

func (*ContainerService) StopAll

func (s *ContainerService) StopAll()

type ContainerServiceParams

type ContainerServiceParams struct {
	Ctx *app.Context

	ContainerAdapter types.ContainerAdapterPort

	ContainerRunnerService   *ContainerRunnerService
	ContainerServiceService  *ContainerServiceService
	ContainerEnvService      *ContainerEnvService
	ContainerSettingsService *ContainerSettingsService
}

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 an 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 an container. The service passed is the latest version of the service.

type ContainerSettingsService

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

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 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 interface{})

func (*ServiceService) Reload

func (s *ServiceService) Reload() error

Jump to

Keyboard shortcuts

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