services

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInstanceAlreadyExists      = errors.New("instance already exists")
	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"),
		},
	}
)
View Source
var (
	ErrDependencyNotInstalled = errors.New("dependency is not installed")
)
View Source
var (
	ErrInvalidPublicKey = errors.New("invalid key")
)

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 (*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 DockerKernelService added in v0.9.0

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

func NewDockerKernelService added in v0.9.0

func NewDockerKernelService(dockerAdapter types.DockerAdapterPort) DockerKernelService

func (DockerKernelService) BuildImage added in v0.9.0

func (DockerKernelService) CreateContainer added in v0.9.0

func (DockerKernelService) DeleteContainer added in v0.9.0

func (s DockerKernelService) DeleteContainer(id string) error

func (DockerKernelService) InfoContainer added in v0.9.0

func (DockerKernelService) InfoImage added in v0.9.0

func (DockerKernelService) ListContainers added in v0.9.0

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

func (DockerKernelService) LogsStderrContainer added in v0.9.0

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

func (DockerKernelService) LogsStdoutContainer added in v0.9.0

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

func (DockerKernelService) PullImage added in v0.9.0

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

func (DockerKernelService) StartContainer added in v0.9.0

func (s DockerKernelService) StartContainer(id string) error

func (DockerKernelService) StopContainer added in v0.9.0

func (s DockerKernelService) StopContainer(id string) error

func (DockerKernelService) WaitContainer added in v0.9.0

func (s DockerKernelService) WaitContainer(id string, cond types.WaitContainerCondition) 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 InstanceEnvService added in v0.10.0

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

func NewInstanceEnvService added in v0.10.0

func NewInstanceEnvService(adapter types.InstanceEnvAdapterPort) InstanceEnvService

func (*InstanceEnvService) Load added in v0.10.0

func (s *InstanceEnvService) Load(inst *types.Instance) error

func (*InstanceEnvService) Save added in v0.10.0

type InstanceLogsService added in v0.10.0

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

func NewInstanceLogsService added in v0.10.0

func NewInstanceLogsService(logsAdapter types.InstanceLogsAdapterPort, eventAdapter types.EventAdapterPort) InstanceLogsService

func (*InstanceLogsService) GetLatestLogs added in v0.10.0

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

func (*InstanceLogsService) GetUUID added in v0.10.0

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

func (*InstanceLogsService) OnEvent added in v0.10.0

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

type InstanceRunnerService added in v0.10.0

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

func NewInstanceRunnerService added in v0.10.0

func NewInstanceRunnerService(eventsAdapter types.EventAdapterPort, dockerRunnerAdapter types.RunnerAdapterPort) InstanceRunnerService

func (*InstanceRunnerService) CheckForUpdates added in v0.10.0

func (s *InstanceRunnerService) CheckForUpdates(inst *types.Instance) error

func (*InstanceRunnerService) Delete added in v0.10.0

func (s *InstanceRunnerService) Delete(inst *types.Instance) error

func (*InstanceRunnerService) GetAllVersions added in v0.10.0

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

func (*InstanceRunnerService) GetDockerContainerInfo added in v0.10.0

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

func (*InstanceRunnerService) Install added in v0.10.0

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

func (*InstanceRunnerService) RecreateContainer added in v0.10.0

func (s *InstanceRunnerService) RecreateContainer(inst *types.Instance) error

RecreateContainer recreates a container by its UUID.

func (*InstanceRunnerService) Start added in v0.10.0

func (s *InstanceRunnerService) Start(inst *types.Instance) 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 (*InstanceRunnerService) Stop added in v0.10.0

func (s *InstanceRunnerService) Stop(inst *types.Instance) 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.

type InstanceService

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

func NewInstanceService

func NewInstanceService(params InstanceServiceParams) InstanceService

func (*InstanceService) CheckForUpdates added in v0.4.0

func (s *InstanceService) CheckForUpdates() (map[uuid.UUID]*types.Instance, 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) Exists added in v0.10.0

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

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

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

func (*InstanceService) LoadAll added in v0.10.0

func (s *InstanceService) LoadAll()

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(inst *types.Instance, databases map[string]uuid.UUID) error

func (*InstanceService) StartAll

func (s *InstanceService) StartAll()

func (*InstanceService) StopAll

func (s *InstanceService) StopAll()

type InstanceServiceParams added in v0.10.0

type InstanceServiceParams struct {
	InstanceAdapter types.InstanceAdapterPort
	EventsAdapter   types.EventAdapterPort

	InstanceRunnerService   *InstanceRunnerService
	InstanceServiceService  *InstanceServiceService
	InstanceEnvService      *InstanceEnvService
	InstanceSettingsService *InstanceSettingsService
}

type InstanceServiceService added in v0.10.0

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

func NewInstanceServiceService added in v0.10.0

func NewInstanceServiceService(instanceServiceAdapter types.InstanceServiceAdapterPort) InstanceServiceService

func (*InstanceServiceService) CheckForUpdate added in v0.10.0

func (s *InstanceServiceService) CheckForUpdate(inst *types.Instance, latest types.Service) error

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

func (*InstanceServiceService) Load added in v0.10.0

func (*InstanceServiceService) Save added in v0.10.0

func (s *InstanceServiceService) Save(inst *types.Instance, service types.Service) error

func (*InstanceServiceService) Update added in v0.10.0

func (s *InstanceServiceService) Update(inst *types.Instance, service types.Service) error

Update updates the service of an instance. The service passed is the latest version of the service.

type InstanceSettingsService added in v0.10.0

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

func NewInstanceSettingsService added in v0.10.0

func NewInstanceSettingsService(instanceSettingsAdapter types.InstanceSettingsAdapterPort) InstanceSettingsService

func (*InstanceSettingsService) Load added in v0.10.0

func (*InstanceSettingsService) Save added in v0.10.0

func (*InstanceSettingsService) SetDatabases added in v0.10.0

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

func (*InstanceSettingsService) SetDisplayName added in v0.10.0

func (s *InstanceSettingsService) SetDisplayName(inst *types.Instance, value string) error

func (*InstanceSettingsService) SetLaunchOnStartup added in v0.10.0

func (s *InstanceSettingsService) SetLaunchOnStartup(inst *types.Instance, value bool) error

func (*InstanceSettingsService) SetVersion added in v0.10.0

func (s *InstanceSettingsService) SetVersion(inst *types.Instance, value string) error

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 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) HandleProxy added in v0.9.0

func (s *ProxyService) HandleProxy(c *router.Context)

func (*ProxyService) RemoveRedirect added in v0.5.0

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

type ServiceService

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

func NewServiceService

func NewServiceService(serviceAdapter types.ServiceAdapterPort) ServiceService

func (*ServiceService) GetAll added in v0.10.0

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

func (*ServiceService) GetById added in v0.10.0

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

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) GetChannel added in v0.9.3

func (*SettingsService) GetNotificationsWebhook added in v0.5.3

func (s *SettingsService) GetNotificationsWebhook() *string

func (*SettingsService) SetChannel added in v0.9.3

func (s *SettingsService) SetChannel(channel *types.SettingsUpdatesChannel) error

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

type SshKernelService added in v0.10.0

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

func NewSshKernelService added in v0.10.0

func NewSshKernelService(sshAdapter types.SshAdapterPort) SshKernelService

func (*SshKernelService) Add added in v0.10.0

func (s *SshKernelService) Add(authorizedKey string) error

Add adds an SSH key to the authorized keys file. The key must be a valid SSH public key, otherwise ErrInvalidPublicKey is returned.

func (*SshKernelService) Delete added in v0.10.0

func (s *SshKernelService) Delete(fingerprint string) error

Delete deletes an SSH key from the authorized keys file.

func (*SshKernelService) GetAll added in v0.10.0

func (s *SshKernelService) GetAll() ([]types.PublicKey, error)

GetAll returns all SSH keys from the authorized keys file.

type SshService added in v0.10.0

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

func NewSshService added in v0.10.0

func NewSshService(sshAdapter types.SshAdapterPort) SshService

func (*SshService) Add added in v0.10.0

func (s *SshService) Add(key string) error

func (*SshService) Delete added in v0.10.0

func (s *SshService) Delete(fingerprint string) error

func (*SshService) GetAll added in v0.10.0

func (s *SshService) GetAll() ([]types.PublicKey, error)

Jump to

Keyboard shortcuts

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