services

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInstanceAlreadyRunning     = errors.New("the instance is already running")
	ErrInstanceNotRunning         = errors.New("the instance is not running")
	ErrInstallMethodDoesNotExists = errors.New("this install method doesn't exist for this service")
)
View Source
var (
	Dependencies = []*types.Dependency{
		{
			ID:      "vertex-webui",
			Name:    "Vertex Web UI",
			Updater: &clientUpdater{},
		},
		{
			ID:      "vertex-services",
			Name:    "Vertex Services",
			Updater: newGitHubUpdater("services", "Vertex Services", "vertex-services"),
		},
		{
			ID:      "vertex-dependencies",
			Name:    "Vertex Dependencies",
			Updater: newGitHubUpdater("packages", "Vertex Dependencies", "vertex-dependencies"),
		},
	}
)
View Source
var (
	ErrDependencyNotInstalled = errors.New("dependency is not installed")
)
View Source
var (
	ErrPkgManagerNotFound = errors.New("package manager not found")
)
View Source
var (
	ErrProxyAlreadyRunning = errors.New("a proxy is already running, cannot start a new one")
)

Functions

This section is empty.

Types

type DependenciesService added in v0.7.0

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

func NewDependenciesService added in v0.7.0

func NewDependenciesService(currentVertexVersion string) DependenciesService

func (*DependenciesService) CheckForUpdates added in v0.7.0

func (s *DependenciesService) CheckForUpdates() (types.Dependencies, error)

func (*DependenciesService) GetCachedUpdates added in v0.7.0

func (s *DependenciesService) GetCachedUpdates() types.Dependencies

func (*DependenciesService) InstallUpdates added in v0.7.0

func (s *DependenciesService) InstallUpdates(dependenciesID []string) error

type HardwareService added in v0.7.0

type HardwareService struct{}

func NewHardwareService added in v0.7.0

func NewHardwareService() HardwareService

func (HardwareService) GetHardware added in v0.7.0

func (s HardwareService) GetHardware() types.Hardware

type InstallCmd

type InstallCmd struct {
	Cmd  string
	Sudo bool
}

type InstanceService

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

func NewInstanceService

func NewInstanceService(serviceAdapter types.ServiceAdapterPort, instanceAdapter types.InstanceAdapterPort, dockerRunnerAdapter types.RunnerAdapterPort, fsRunnerAdapter types.RunnerAdapterPort, instanceLogsAdapter types.InstanceLogsAdapterPort, eventRepo types.EventAdapterPort) InstanceService

func (*InstanceService) CheckForServiceUpdate added in v0.6.0

func (s *InstanceService) CheckForServiceUpdate(uuid uuid.UUID) error

CheckForServiceUpdate checks if the service of an instance has an update. If it has, it sets the instance's ServiceUpdate field.

func (*InstanceService) CheckForUpdates added in v0.4.0

func (s *InstanceService) CheckForUpdates() (map[uuid.UUID]*types.Instance, error)

func (*InstanceService) CloneRepository added in v0.3.0

func (s *InstanceService) CloneRepository(dir string, url string) error

func (*InstanceService) Delete

func (s *InstanceService) Delete(uuid uuid.UUID) error

Delete deletes an instance by its UUID. If the instance does not exist, it returns ErrInstanceNotFound. If the instance is still running, it returns ErrInstanceStillRunning.

func (*InstanceService) DownloadRelease added in v0.3.0

func (s *InstanceService) DownloadRelease(dir string, repo string) error

func (*InstanceService) Get

func (s *InstanceService) Get(uuid uuid.UUID) (*types.Instance, error)

Get returns an instance by its UUID. If the instance does not exist, it returns ErrInstanceNotFound.

func (*InstanceService) GetAll

func (s *InstanceService) GetAll() map[uuid.UUID]*types.Instance

func (*InstanceService) GetDockerContainerInfo added in v0.1.1

func (s *InstanceService) GetDockerContainerInfo(uuid uuid.UUID) (map[string]any, error)

func (*InstanceService) GetLatestLogs added in v0.1.1

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

func (*InstanceService) GetUUID added in v0.1.1

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

func (*InstanceService) Install

func (s *InstanceService) Install(serviceID string, method string) (*types.Instance, error)

func (*InstanceService) OnEvent added in v0.1.1

func (s *InstanceService) OnEvent(e interface{})

func (*InstanceService) PreInstallForDocker added in v0.3.0

func (s *InstanceService) PreInstallForDocker(service types.Service, dir string) error

func (*InstanceService) PreInstallForRelease added in v0.3.0

func (s *InstanceService) PreInstallForRelease(service types.Service, dir string) error

func (*InstanceService) PreInstallForScript added in v0.3.0

func (s *InstanceService) PreInstallForScript(service types.Service, dir string) error

func (*InstanceService) RecreateContainer added in v0.4.3

func (s *InstanceService) RecreateContainer(instance *types.Instance) error

RecreateContainer recreates a container by its UUID.

func (*InstanceService) Search added in v0.6.0

func (s *InstanceService) Search(query types.InstanceQuery) map[uuid.UUID]*types.Instance

Search returns all instances that match the query.

func (*InstanceService) SetDatabases added in v0.6.0

func (s *InstanceService) SetDatabases(id uuid.UUID, databases map[string]uuid.UUID) error

func (*InstanceService) SetDisplayName added in v0.3.2

func (s *InstanceService) SetDisplayName(uuid uuid.UUID, value string) error

func (*InstanceService) SetLaunchOnStartup

func (s *InstanceService) SetLaunchOnStartup(uuid uuid.UUID, value bool) error

func (*InstanceService) Start

func (s *InstanceService) Start(uuid uuid.UUID) error

Start starts an instance by its UUID. If the instance does not exist, it returns ErrInstanceNotFound. If the instance is already running, it returns ErrInstanceAlreadyRunning.

func (*InstanceService) StartAll

func (s *InstanceService) StartAll()

func (*InstanceService) Stop

func (s *InstanceService) Stop(uuid uuid.UUID) error

Stop stops an instance by its UUID. If the instance does not exist, it returns ErrInstanceNotFound. If the instance is not running, it returns ErrInstanceNotRunning.

func (*InstanceService) StopAll

func (s *InstanceService) StopAll()
func (s *InstanceService) Symlink(path string, repo string) error

func (*InstanceService) UpdateService added in v0.6.0

func (s *InstanceService) UpdateService(uuid uuid.UUID) error

func (*InstanceService) WriteEnv

func (s *InstanceService) WriteEnv(uuid uuid.UUID, environment map[string]string) error

WriteEnv writes environment variables to an instance by its UUID. If the instance does not exist, it returns ErrInstanceNotFound.

type NotificationsService added in v0.5.3

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

func NewNotificationsService added in v0.5.3

func NewNotificationsService(settingsAdapter types.SettingsAdapterPort, eventsAdapter types.EventAdapterPort, instanceAdapter types.InstanceAdapterPort) NotificationsService

func (*NotificationsService) StartWebhook added in v0.5.3

func (s *NotificationsService) StartWebhook() error

func (*NotificationsService) StopWebhook added in v0.5.3

func (s *NotificationsService) StopWebhook()

type PackageService

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

func NewPackageService

func NewPackageService(packageAdapter types.PackageAdapterPort) PackageService

func (*PackageService) GetByID added in v0.5.6

func (s *PackageService) GetByID(id string) (types.Package, error)

func (*PackageService) Install

func (s *PackageService) Install(c InstallCmd) error

func (*PackageService) InstallationCommand

func (s *PackageService) InstallationCommand(p *types.Package, pm string) (InstallCmd, error)

func (*PackageService) Reload added in v0.5.4

func (s *PackageService) Reload() error

type ProxyService added in v0.5.0

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

func NewProxyService added in v0.5.0

func NewProxyService(proxyAdapter types.ProxyAdapterPort) ProxyService

func (*ProxyService) AddRedirect added in v0.5.0

func (s *ProxyService) AddRedirect(redirect types.ProxyRedirect) error

func (*ProxyService) GetRedirects added in v0.5.0

func (s *ProxyService) GetRedirects() types.ProxyRedirects

func (*ProxyService) RemoveRedirect added in v0.5.0

func (s *ProxyService) RemoveRedirect(id uuid.UUID) error

func (*ProxyService) Start added in v0.5.0

func (s *ProxyService) Start() error

func (*ProxyService) Stop added in v0.5.0

func (s *ProxyService) Stop() error

type ServiceService

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

func NewServiceService

func NewServiceService(serviceAdapter types.ServiceAdapterPort) ServiceService

func (*ServiceService) ListAvailable

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

func (*ServiceService) Reload added in v0.5.4

func (s *ServiceService) Reload() error

type SettingsService added in v0.5.3

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

func NewSettingsService added in v0.5.3

func NewSettingsService(settingsAdapter types.SettingsAdapterPort) SettingsService

func (*SettingsService) GetNotificationsWebhook added in v0.5.3

func (s *SettingsService) GetNotificationsWebhook() *string

func (*SettingsService) SetNotificationsWebhook added in v0.5.3

func (s *SettingsService) SetNotificationsWebhook(webhook *string) error

func (*SettingsService) Update added in v0.5.3

func (s *SettingsService) Update(settings types.Settings) error

Jump to

Keyboard shortcuts

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