adapter

package
v0.9.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInstanceAlreadyExists = errors.New("instance already exists")
	ErrContainerNotFound     = errors.New("container not found")
)
View Source
var (
	ErrLoggerNotFound = errors.New("instance logger not found")
)
View Source
var (
	ErrPkgNotFound = errors.New("package not found")
)

Functions

func NewEventInMemoryAdapter

func NewEventInMemoryAdapter() types.EventAdapterPort

func NewInstanceFSAdapter

func NewInstanceFSAdapter(params *InstanceFSAdapterParams) types.InstanceAdapterPort

func NewInstanceLogsFSAdapter

func NewInstanceLogsFSAdapter() types.InstanceLogsAdapterPort

func NewPackageFSAdapter

func NewPackageFSAdapter(params *PackageFSAdapterParams) types.PackageAdapterPort

func NewProxyFSAdapter

func NewProxyFSAdapter(params *ProxyFSAdapterParams) types.ProxyAdapterPort

func NewServiceFSAdapter

func NewServiceFSAdapter(params *ServiceFSAdapterParams) types.ServiceAdapterPort

func NewSettingsFSAdapter

func NewSettingsFSAdapter(params *SettingsFSAdapterParams) types.SettingsAdapterPort

Types

type DockerCliAdapter added in v0.9.0

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

func NewDockerCliAdapter added in v0.9.0

func NewDockerCliAdapter() DockerCliAdapter

func (DockerCliAdapter) BuildImage added in v0.9.0

func (DockerCliAdapter) CreateContainer added in v0.9.0

func (DockerCliAdapter) DeleteContainer added in v0.9.0

func (a DockerCliAdapter) DeleteContainer(id string) error

func (DockerCliAdapter) InfoContainer added in v0.9.0

func (a DockerCliAdapter) InfoContainer(id string) (types.InfoContainerResponse, error)

func (DockerCliAdapter) InfoImage added in v0.9.0

func (DockerCliAdapter) ListContainers added in v0.9.0

func (a DockerCliAdapter) ListContainers() ([]types.Container, error)

func (DockerCliAdapter) LogsStderrContainer added in v0.9.0

func (a DockerCliAdapter) LogsStderrContainer(id string) (io.ReadCloser, error)

func (DockerCliAdapter) LogsStdoutContainer added in v0.9.0

func (a DockerCliAdapter) LogsStdoutContainer(id string) (io.ReadCloser, error)

func (DockerCliAdapter) PullImage added in v0.9.0

func (a DockerCliAdapter) PullImage(options types.PullImageOptions) (io.ReadCloser, error)

func (DockerCliAdapter) StartContainer added in v0.9.0

func (a DockerCliAdapter) StartContainer(id string) error

func (DockerCliAdapter) StopContainer added in v0.9.0

func (a DockerCliAdapter) StopContainer(id string) error

func (DockerCliAdapter) WaitContainer added in v0.9.0

func (a DockerCliAdapter) WaitContainer(id string, cond types.WaitContainerCondition) error

type EventInMemoryAdapter

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

func (*EventInMemoryAdapter) AddListener

func (a *EventInMemoryAdapter) AddListener(l types.Listener)

func (*EventInMemoryAdapter) RemoveListener

func (a *EventInMemoryAdapter) RemoveListener(l types.Listener)

func (*EventInMemoryAdapter) Send

func (a *EventInMemoryAdapter) Send(e interface{})

type InstanceFSAdapter

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

func (*InstanceFSAdapter) Delete

func (a *InstanceFSAdapter) Delete(uuid uuid.UUID) error

func (*InstanceFSAdapter) Exists

func (a *InstanceFSAdapter) Exists(uuid uuid.UUID) bool

func (*InstanceFSAdapter) Get

func (a *InstanceFSAdapter) Get(uuid uuid.UUID) (*types.Instance, error)

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

func (*InstanceFSAdapter) GetAll

func (a *InstanceFSAdapter) GetAll() map[uuid.UUID]*types.Instance

func (*InstanceFSAdapter) GetFilePath added in v0.6.0

func (a *InstanceFSAdapter) GetFilePath(uuid uuid.UUID, filepath InstanceFilePath) string

func (*InstanceFSAdapter) GetPath

func (a *InstanceFSAdapter) GetPath(uuid uuid.UUID) string

func (*InstanceFSAdapter) LoadEnv

func (a *InstanceFSAdapter) LoadEnv(i *types.Instance) error

func (*InstanceFSAdapter) LoadService added in v0.6.0

func (a *InstanceFSAdapter) LoadService(instancePath string) (types.Service, error)

func (*InstanceFSAdapter) LoadServiceRaw added in v0.6.0

func (a *InstanceFSAdapter) LoadServiceRaw(instancePath string) (interface{}, error)

func (*InstanceFSAdapter) LoadSettings

func (a *InstanceFSAdapter) LoadSettings(i *types.Instance) error

func (*InstanceFSAdapter) Reload

func (a *InstanceFSAdapter) Reload(load func(uuid uuid.UUID))

func (*InstanceFSAdapter) SaveEnv

func (a *InstanceFSAdapter) SaveEnv(i *types.Instance) error

func (*InstanceFSAdapter) SaveService added in v0.6.0

func (a *InstanceFSAdapter) SaveService(instance *types.Instance) error

func (*InstanceFSAdapter) SaveSettings

func (a *InstanceFSAdapter) SaveSettings(i *types.Instance) error

func (*InstanceFSAdapter) Search added in v0.6.0

func (*InstanceFSAdapter) Set

func (a *InstanceFSAdapter) Set(uuid uuid.UUID, instance types.Instance) error

type InstanceFSAdapterParams added in v0.6.0

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

type InstanceFilePath added in v0.6.0

type InstanceFilePath string
const (
	InstanceVertexPath   InstanceFilePath = ".vertex"
	InstanceSettingsPath InstanceFilePath = ".vertex/instance_settings.json"
	InstanceServicePath  InstanceFilePath = ".vertex/service.yml"
	InstanceEnvPath      InstanceFilePath = ".env"
)

type InstanceLogger

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

func (*InstanceLogger) Close

func (l *InstanceLogger) Close() error

type InstanceLogsFSAdapter

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

func (*InstanceLogsFSAdapter) Close

func (a *InstanceLogsFSAdapter) Close(uuid uuid.UUID) error

func (*InstanceLogsFSAdapter) CloseAll

func (a *InstanceLogsFSAdapter) CloseAll() error

func (*InstanceLogsFSAdapter) LoadBuffer

func (a *InstanceLogsFSAdapter) LoadBuffer(uuid uuid.UUID) ([]types.LogLine, error)

func (*InstanceLogsFSAdapter) Open

func (a *InstanceLogsFSAdapter) Open(uuid uuid.UUID) error

func (*InstanceLogsFSAdapter) Push

func (a *InstanceLogsFSAdapter) Push(uuid uuid.UUID, line types.LogLine)

type PackageFSAdapter

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

func (*PackageFSAdapter) GetByID

func (a *PackageFSAdapter) GetByID(id string) (types.Package, error)

func (*PackageFSAdapter) GetPath

func (a *PackageFSAdapter) GetPath(id string) string

func (*PackageFSAdapter) Reload

func (a *PackageFSAdapter) Reload() error

type PackageFSAdapterParams

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

type ProxyFSAdapter added in v0.5.8

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

func (*ProxyFSAdapter) AddRedirect added in v0.5.8

func (a *ProxyFSAdapter) AddRedirect(id uuid.UUID, redirect types.ProxyRedirect) error

func (*ProxyFSAdapter) GetRedirectByHost added in v0.6.0

func (a *ProxyFSAdapter) GetRedirectByHost(host string) *types.ProxyRedirect

func (*ProxyFSAdapter) GetRedirects added in v0.5.8

func (a *ProxyFSAdapter) GetRedirects() types.ProxyRedirects

func (*ProxyFSAdapter) RemoveRedirect added in v0.5.8

func (a *ProxyFSAdapter) RemoveRedirect(id uuid.UUID) error

type ProxyFSAdapterParams

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

type RunnerDockerAdapter

type RunnerDockerAdapter struct{}

func NewRunnerDockerAdapter

func NewRunnerDockerAdapter() RunnerDockerAdapter

func (RunnerDockerAdapter) CheckForUpdates

func (a RunnerDockerAdapter) CheckForUpdates(instance *types.Instance) error

func (RunnerDockerAdapter) Delete

func (a RunnerDockerAdapter) Delete(instance *types.Instance) error

func (RunnerDockerAdapter) HasUpdateAvailable

func (a RunnerDockerAdapter) HasUpdateAvailable(instance types.Instance) (bool, error)

func (RunnerDockerAdapter) Info

func (a RunnerDockerAdapter) Info(instance types.Instance) (map[string]any, error)

func (RunnerDockerAdapter) Start

func (a RunnerDockerAdapter) Start(instance *types.Instance, setStatus func(status string)) (io.ReadCloser, io.ReadCloser, error)

func (RunnerDockerAdapter) Stop

func (a RunnerDockerAdapter) Stop(instance *types.Instance) error

type RunnerFSAdapter

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

func NewRunnerFSAdapter

func NewRunnerFSAdapter() RunnerFSAdapter

func (RunnerFSAdapter) CheckForUpdates

func (a RunnerFSAdapter) CheckForUpdates(instance *types.Instance) error

func (RunnerFSAdapter) Delete

func (a RunnerFSAdapter) Delete(instance *types.Instance) error

func (RunnerFSAdapter) HasUpdateAvailable

func (a RunnerFSAdapter) HasUpdateAvailable(instance types.Instance) (bool, error)

func (RunnerFSAdapter) Info

func (a RunnerFSAdapter) Info(instance types.Instance) (map[string]any, error)

func (RunnerFSAdapter) Start

func (a RunnerFSAdapter) Start(instance *types.Instance, setStatus func(status string)) (stdout io.ReadCloser, stderr io.ReadCloser, err error)

func (RunnerFSAdapter) Stop

func (a RunnerFSAdapter) Stop(instance *types.Instance) error

type ServiceFSAdapter

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

func (*ServiceFSAdapter) Get

func (a *ServiceFSAdapter) Get(id string) (types.Service, error)

func (*ServiceFSAdapter) GetAll

func (a *ServiceFSAdapter) GetAll() []types.Service

func (*ServiceFSAdapter) GetRaw added in v0.6.0

func (a *ServiceFSAdapter) GetRaw(id string) (interface{}, error)

func (*ServiceFSAdapter) GetScript

func (a *ServiceFSAdapter) GetScript(id string) ([]byte, error)

func (*ServiceFSAdapter) Reload

func (a *ServiceFSAdapter) Reload() error

type ServiceFSAdapterParams

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

type SettingsFSAdapter

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

func (*SettingsFSAdapter) GetNotificationsWebhook

func (a *SettingsFSAdapter) GetNotificationsWebhook() *string

func (*SettingsFSAdapter) GetSettings

func (a *SettingsFSAdapter) GetSettings() types.Settings

func (*SettingsFSAdapter) SetNotificationsWebhook

func (a *SettingsFSAdapter) SetNotificationsWebhook(webhook *string) error

type SettingsFSAdapterParams

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

Jump to

Keyboard shortcuts

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