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: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDbmsAlreadySet           = errors.New("dbms already set")
	ErrPostgresDatabaseNotFound = errors.New("vertex postgres database not found")
)
View Source
var (
	ErrInvalidPublicKey = errors.New("invalid key")
	ErrUserNotFound     = errors.New("user not found")
	ErrFailedToAddKey   = errors.New("failed to add key")
)

Functions

func NewAdminSettingsService added in v0.16.0

func NewAdminSettingsService(adapter port.AdminSettingsAdapter) port.AdminSettingsService

func NewAppsService

func NewAppsService(ctx *types.VertexContext, kernel bool, router *router.Router, apps []app.Interface) port.AppsService

func NewChecksService added in v0.16.0

func NewChecksService() port.ChecksService

func NewDbService added in v0.16.0

func NewDbService(ctx *vtypes.VertexContext, dataConfigAdapter port.DbAdapter) port.DbService

func NewDebugService added in v0.14.0

func NewDebugService(ctx *types.VertexContext) port.DebugService

func NewHardwareService

func NewHardwareService() port.HardwareService

func NewSshKernelService

func NewSshKernelService(sshAdapter port.SshKernelAdapter) port.SshKernelService

func NewSshService

func NewSshService(sshAdapter port.SshAdapter) port.SshService

func NewUpdateService

func NewUpdateService(ctx *types.VertexContext, adapter port.BaselinesAdapter, updaters []types.Updater) port.UpdateService

Types

type AdminSettingsService added in v0.16.0

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

func (*AdminSettingsService) Get added in v0.16.0

func (*AdminSettingsService) GetChannel added in v0.16.0

func (s *AdminSettingsService) GetChannel() (types.UpdatesChannel, error)

func (*AdminSettingsService) GetWebhook added in v0.16.0

func (s *AdminSettingsService) GetWebhook() (*string, error)

func (*AdminSettingsService) SetChannel added in v0.16.0

func (s *AdminSettingsService) SetChannel(channel types.UpdatesChannel) error

func (*AdminSettingsService) SetWebhook added in v0.16.0

func (s *AdminSettingsService) SetWebhook(webhook string) error

func (*AdminSettingsService) Update added in v0.16.0

func (s *AdminSettingsService) Update(settings types.AdminSettings) error

type AppsService

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

func (*AppsService) All

func (s *AppsService) All() []app.Meta

func (*AppsService) GetUUID

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

func (*AppsService) OnEvent

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

func (*AppsService) StartApps

func (s *AppsService) StartApps()

func (*AppsService) StopApps

func (s *AppsService) StopApps()

type ChecksService added in v0.16.0

type ChecksService struct{}

ChecksService is a service used to check if Vertex is ready to serve or not.

func (*ChecksService) CheckAll added in v0.16.0

func (s *ChecksService) CheckAll(ctx context.Context) <-chan types.CheckResponse

CheckAll checks if Vertex is ready to serve, by doing some checks like internet connection, api readiness, etc. It returns a channel of CheckResponse, which contains the result of each check. The channel is closed when all checks are done.

type DbService added in v0.16.0

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

func (*DbService) GetCurrentDbms added in v0.16.0

func (s *DbService) GetCurrentDbms() vtypes.DbmsName

func (*DbService) GetUUID added in v0.16.0

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

func (*DbService) MigrateTo added in v0.16.0

func (s *DbService) MigrateTo(dbms vtypes.DbmsName) error

func (*DbService) OnEvent added in v0.16.0

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

type DebugService added in v0.14.0

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

func (*DebugService) HardReset added in v0.14.0

func (s *DebugService) HardReset()

type HardwareService

type HardwareService struct{}

func (HardwareService) GetCPUs added in v0.16.0

func (s HardwareService) GetCPUs() ([]types.CPU, error)

func (HardwareService) GetHost added in v0.16.0

func (s HardwareService) GetHost() (types.Host, error)

type NotificationsService

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

func NewNotificationsService

func NewNotificationsService(ctx *types.VertexContext, settingsAdapter port.AdminSettingsAdapter) NotificationsService

func (*NotificationsService) GetUUID

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

func (*NotificationsService) OnEvent

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

func (*NotificationsService) StartWebhook

func (s *NotificationsService) StartWebhook() error

func (*NotificationsService) StopWebhook

func (s *NotificationsService) StopWebhook()

type SshKernelService

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

func (*SshKernelService) Add

func (s *SshKernelService) Add(authorizedKey string, username 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

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

Delete deletes an SSH key from the authorized keys file.

func (*SshKernelService) GetAll

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

GetAll returns all SSH keys from the authorized keys files.

func (*SshKernelService) GetUser added in v0.16.0

func (s *SshKernelService) GetUser(username string) (user.User, error)

func (*SshKernelService) GetUsers added in v0.16.0

func (s *SshKernelService) GetUsers() ([]user.User, error)

GetUsers returns all users on the system that can have SSH keys.

type SshService

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

func (*SshService) Add

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

func (*SshService) Delete

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

func (*SshService) GetAll

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

func (*SshService) GetUsers added in v0.16.0

func (s *SshService) GetUsers() ([]string, error)

type UpdateService

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

func (*UpdateService) GetUUID

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

func (*UpdateService) GetUpdate

func (s *UpdateService) GetUpdate(channel types.UpdatesChannel) (*types.Update, error)

func (*UpdateService) InstallLatest

func (s *UpdateService) InstallLatest(channel types.UpdatesChannel) error

func (*UpdateService) OnEvent

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

Jump to

Keyboard shortcuts

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