Documentation
¶
Index ¶
- Constants
- Variables
- type APIError
- type About
- type BuildImageOptions
- type Container
- type CreateContainerOptions
- type CreateContainerResponse
- type DatabaseEnvironment
- type DatabaseEnvironmentNames
- type DatabaseFeature
- type Dependencies
- type Dependency
- type DependencyUpdate
- type DependencyUpdater
- type DockerAdapterPort
- type EnvVariables
- type EventAdapterPort
- type EventInstanceLog
- type EventInstanceStatusChange
- type EventInstancesChange
- type Features
- type Hardware
- type Host
- type InfoContainerResponse
- type InfoImageResponse
- type Instance
- func (i *Instance) DockerContainerName() string
- func (i *Instance) DockerImageName() string
- func (i *Instance) HasFeature(featureType string) bool
- func (i *Instance) HasOneOfFeatures(featureTypes []string) bool
- func (i *Instance) IsDockerized() bool
- func (i *Instance) IsRunning() bool
- func (i *Instance) LaunchOnStartup() bool
- func (i *Instance) ResetDefaultEnv()
- type InstanceAdapterPort
- type InstanceLogsAdapterPort
- type InstanceQuery
- type InstanceSettings
- type InstanceUpdate
- type Listener
- type LogLine
- type Mount
- type Package
- type PackageAdapterPort
- type ProxyAdapterPort
- type ProxyRedirect
- type ProxyRedirects
- type PublicKey
- type PullImageOptions
- type RunnerAdapterPort
- type Service
- type ServiceAdapterPort
- type ServiceClone
- type ServiceDependency
- type ServiceEnv
- type ServiceMethodDocker
- type ServiceMethodRelease
- type ServiceMethodScript
- type ServiceMethods
- type ServiceUpdate
- type ServiceV1
- type ServiceVersioning
- type Settings
- type SettingsAdapterPort
- type SettingsNotifications
- type TempListener
- type URL
- type Version
- type WaitContainerCondition
Constants ¶
View Source
const ( EventNameInstancesChange = "change" EventNameInstanceStatusChange = "status_change" EventNameInstanceStdout = "stdout" EventNameInstanceStderr = "stderr" )
View Source
const ( InstanceStatusOff = "off" InstanceStatusBuilding = "building" InstanceStatusStarting = "starting" InstanceStatusRunning = "running" InstanceStatusStopping = "stopping" InstanceStatusError = "error" )
View Source
const ( InstanceInstallMethodScript = "script" InstanceInstallMethodRelease = "release" InstanceInstallMethodDocker = "docker" )
View Source
const ( LogKindOut = "out" LogKindErr = "err" LogKindVertexOut = "vertex_out" LogKindVertexErr = "vertex_err" )
View Source
const ( PmNone = "sources" PmAptGet = "apt-get" PmBrew = "brew" PmNpm = "npm" PmPacman = "pacman" PmSnap = "snap" )
Variables ¶
View Source
var ( ErrInstanceNotFound = errors.New("instance not found") ErrInstanceStillRunning = errors.New("instance still running") )
View Source
var (
ErrServiceNotFound = errors.New("the service was not found")
)
Functions ¶
This section is empty.
Types ¶
type BuildImageOptions ¶ added in v0.9.0
type Container ¶ added in v0.9.0
type Container struct { ID string `json:"id,omitempty"` ImageID string `json:"image_id,omitempty"` Names []string `json:"names,omitempty"` Mounts []Mount `json:"mounts,omitempty"` }
func NewContainer ¶ added in v0.9.0
func NewContainer(c dockertypes.Container) Container
type CreateContainerOptions ¶ added in v0.9.0
type CreateContainerOptions struct { ImageName string `json:"image_name,omitempty"` ContainerName string `json:"container_name,omitempty"` ExposedPorts nat.PortSet `json:"exposed_ports,omitempty"` PortBindings nat.PortMap `json:"port_bindings,omitempty"` Binds []string `json:"binds,omitempty"` Env []string `json:"env,omitempty"` CapAdd []string `json:"cap_add,omitempty"` Sysctls map[string]string `json:"sysctls,omitempty"` }
type CreateContainerResponse ¶ added in v0.9.0
type DatabaseEnvironment ¶ added in v0.6.0
type DatabaseEnvironment struct { // DisplayName is a readable name for the user. DisplayName string `yaml:"display_name" json:"display_name"` // The database Types. Can be redis, postgres... Types []string `yaml:"types" json:"types"` // The database environment names. Names DatabaseEnvironmentNames `yaml:"names" json:"names"` }
type DatabaseEnvironmentNames ¶ added in v0.6.0
type DatabaseFeature ¶ added in v0.4.0
type DatabaseFeature struct { // The database Type. Can be redis, postgres... Type string `yaml:"type" json:"type"` // The database Port. Must be the name // of an environment variable. Port string `yaml:"port" json:"port"` // The Username to connect to the database. Must be the name // of an environment variable. Username *string `yaml:"username" json:"username"` // The Password to connect to the database. Must be the name // of an environment variable. Password *string `yaml:"password" json:"password"` }
type Dependencies ¶ added in v0.7.0
type Dependencies struct { LastUpdatesCheck *time.Time `json:"last_updates_check"` Items []*Dependency `json:"items"` }
type Dependency ¶
type Dependency struct { ID string `json:"id"` Name string `json:"name"` Version string `json:"version"` Update *DependencyUpdate `json:"update,omitempty"` Updater DependencyUpdater `json:"-"` }
type DependencyUpdate ¶ added in v0.7.0
type DependencyUpdater ¶ added in v0.7.0
type DependencyUpdater interface { // CheckForUpdate will check if the dependency has an update available. If // true, it returns the Dependency, or nil otherwise. CheckForUpdate() (*DependencyUpdate, error) // InstallUpdate will install the previously fetched update. InstallUpdate() error // GetCurrentVersion returns the current version of the dependency. GetCurrentVersion() string // GetPath returns the path of the dependency. GetPath() string }
DependencyUpdater describes main vertex programs that Vertex needs to run, like Vertex, Vertex Services, Vertex Web UI...
type DockerAdapterPort ¶ added in v0.9.0
type DockerAdapterPort interface { ListContainers() ([]Container, error) DeleteContainer(id string) error CreateContainer(options CreateContainerOptions) (CreateContainerResponse, error) StartContainer(id string) error StopContainer(id string) error InfoContainer(id string) (InfoContainerResponse, error) LogsStdoutContainer(id string) (io.ReadCloser, error) LogsStderrContainer(id string) (io.ReadCloser, error) WaitContainer(id string, cond WaitContainerCondition) error InfoImage(id string) (InfoImageResponse, error) PullImage(options PullImageOptions) (io.ReadCloser, error) BuildImage(options BuildImageOptions) (dockertypes.ImageBuildResponse, error) }
type EnvVariables ¶
type EventAdapterPort ¶ added in v0.5.6
type EventInstanceLog ¶ added in v0.1.1
type EventInstanceStatusChange ¶ added in v0.1.1
type EventInstancesChange ¶ added in v0.1.1
type EventInstancesChange struct{}
type Features ¶ added in v0.4.0
type Features struct { // The database feature describes the database made available // by this service. Databases *[]DatabaseFeature `yaml:"databases" json:"databases"` }
type Host ¶ added in v0.7.0
type Host struct { // OS is the operating system name. // Example: "linux" OS string `json:"os"` // Arch is the hardware architecture. // Example: "arm64" Arch string `json:"arch"` // Platform is the platform name. // Example: "arch" Platform string `json:"platform"` // Version is the platform version. // Example: "13.5.2" Version string `json:"version"` // Name is the hostname. // Example: "my-host" Name string `json:"name"` }
type InfoContainerResponse ¶ added in v0.9.0
type InfoImageResponse ¶ added in v0.9.0
type Instance ¶
type Instance struct { InstanceSettings Service Service `json:"service"` UUID uuid.UUID `json:"uuid"` Status string `json:"status"` Env EnvVariables `json:"environment,omitempty"` Update *InstanceUpdate `json:"update,omitempty"` ServiceUpdate ServiceUpdate `json:"service_update,omitempty"` }
func (*Instance) DockerContainerName ¶
func (*Instance) DockerImageName ¶
func (*Instance) HasFeature ¶ added in v0.6.0
func (*Instance) HasOneOfFeatures ¶ added in v0.6.0
func (*Instance) IsDockerized ¶ added in v0.1.1
func (*Instance) LaunchOnStartup ¶ added in v0.6.0
func (*Instance) ResetDefaultEnv ¶ added in v0.6.0
func (i *Instance) ResetDefaultEnv()
type InstanceAdapterPort ¶ added in v0.5.6
type InstanceAdapterPort interface { Get(uuid uuid.UUID) (*Instance, error) GetAll() map[uuid.UUID]*Instance Search(query InstanceQuery) map[uuid.UUID]*Instance GetPath(uuid uuid.UUID) string Delete(uuid uuid.UUID) error Exists(uuid uuid.UUID) bool Set(uuid uuid.UUID, instance Instance) error SaveSettings(i *Instance) error LoadSettings(i *Instance) error SaveEnv(i *Instance) error LoadEnv(i *Instance) error SaveService(i *Instance) error LoadService(instancePath string) (Service, error) LoadServiceRaw(instancePath string) (interface{}, error) Reload(func(uuid uuid.UUID)) }
type InstanceLogsAdapterPort ¶ added in v0.5.6
type InstanceQuery ¶ added in v0.6.0
type InstanceQuery struct {
Features []string `json:"features,omitempty"`
}
type InstanceSettings ¶ added in v0.4.5
type InstanceSettings struct { // Method indicates how the instance is installed. // It can be by script, release or docker. InstallMethod *string `json:"install_method,omitempty"` // LaunchOnStartup indicates if the instance needs to start automatically when Vertex starts. // The default value is true. LaunchOnStartup *bool `json:"launch_on_startup,omitempty"` // DisplayName is a custom name for the instance. DisplayName *string `json:"display_name,omitempty"` // Database describes the databases used by the instance. // The key is the database ID, and the value is the database instance UUID. Databases map[string]uuid.UUID `json:"databases,omitempty"` }
type InstanceUpdate ¶ added in v0.4.0
type Mount ¶ added in v0.9.0
type Mount struct { Source string `json:"source,omitempty"` Destination string `json:"destination,omitempty"` }
func NewMount ¶ added in v0.9.0
func NewMount(m dockertypes.MountPoint) Mount
func NewMounts ¶ added in v0.9.0
func NewMounts(m []dockertypes.MountPoint) []Mount
type PackageAdapterPort ¶ added in v0.5.6
type ProxyAdapterPort ¶ added in v0.5.6
type ProxyAdapterPort interface { GetRedirects() ProxyRedirects GetRedirectByHost(host string) *ProxyRedirect AddRedirect(id uuid.UUID, redirect ProxyRedirect) error RemoveRedirect(id uuid.UUID) error }
type ProxyRedirect ¶ added in v0.5.0
type ProxyRedirects ¶ added in v0.5.0
type ProxyRedirects map[uuid.UUID]ProxyRedirect
type PullImageOptions ¶ added in v0.9.0
type PullImageOptions struct {
Image string `json:"image,omitempty"`
}
type RunnerAdapterPort ¶ added in v0.5.6
type RunnerAdapterPort interface { Delete(instance *Instance) error Start(instance *Instance, setStatus func(status string)) (stdout io.ReadCloser, stderr io.ReadCloser, err error) Stop(instance *Instance) error Info(instance Instance) (map[string]any, error) CheckForUpdates(instance *Instance) error HasUpdateAvailable(instance Instance) (bool, error) }
type Service ¶
type Service struct { ServiceVersioning `yaml:",inline"` // ID is the identifier of the service. It must be unique. ID string `yaml:"id" json:"id"` // Name is the displayed name of the service. Name string `yaml:"name" json:"name"` // Repository is the url of the repository, if it is an external repository. Repository *string `yaml:"repository,omitempty" json:"repository,omitempty"` // Description describes the service in a few words. Description string `yaml:"description" json:"description"` // Color is the main color of the service. Color *string `yaml:"color,omitempty" json:"color,omitempty"` // Icon is the icon link of the service, located in ./live/services/icons/. Icon *string `yaml:"icon,omitempty" json:"icon,omitempty"` // Features describes some features of the service to help Vertex. Features *Features `yaml:"features,omitempty" json:"features,omitempty"` // Env defines all parameterizable environment variables. Env []ServiceEnv `yaml:"environment,omitempty" json:"environment,omitempty"` // Databases defines all databases used by the service. Databases map[string]DatabaseEnvironment `yaml:"databases,omitempty" json:"databases,omitempty"` // URLs defines all service urls. URLs []URL `yaml:"urls,omitempty" json:"urls,omitempty"` // Methods defines different methods to install the service. Methods ServiceMethods `yaml:"methods" json:"methods"` }
func (*Service) UnmarshalYAML ¶ added in v0.6.0
type ServiceAdapterPort ¶ added in v0.5.6
type ServiceAdapterPort interface { // Get a service with its id. Returns ErrServiceNotFound if // the service was not found. Get(id string) (Service, error) GetScript(id string) ([]byte, error) // GetRaw gets a service by id, without any processing. // Returns ErrServiceNotFound if the service was not found. GetRaw(id string) (interface{}, error) // GetAll gets all available services. GetAll() []Service // Reload the adapter Reload() error }
type ServiceClone ¶ added in v0.3.0
type ServiceClone struct {
Repository string `yaml:"repository" json:"repository"`
}
type ServiceDependency ¶ added in v0.3.0
type ServiceDependency struct{}
type ServiceEnv ¶ added in v0.6.0
type ServiceEnv struct { // Type is the environment variable type. // It can be: port, string, url. Type string `yaml:"type" json:"type"` // Name is the environment variable name that will be used by the service. Name string `yaml:"name" json:"name"` // DisplayName is a readable name for the user. DisplayName string `yaml:"display_name" json:"display_name"` // Secret is true if the value should not be read. Secret *bool `yaml:"secret,omitempty" json:"secret,omitempty"` // Default defines a default value. Default string `yaml:"default,omitempty" json:"default,omitempty"` // Description describes this variable to the user. Description string `yaml:"description" json:"description"` }
type ServiceMethodDocker ¶ added in v0.1.1
type ServiceMethodDocker struct { // Image is the Docker image to run. Image *string `yaml:"image,omitempty" json:"image,omitempty"` // Clone describes the repository to clone if some files are needed to run the script. Clone *ServiceClone `yaml:"clone,omitempty" json:"clone,omitempty"` // Dockerfile is the name of the Dockerfile if the repository is cloned. Dockerfile *string `yaml:"dockerfile,omitempty" json:"dockerfile,omitempty"` // Ports is a map containing docker port as a key, and output port as a value. // The output port is automatically adjusted with PORT environment variables. Ports *map[string]string `yaml:"ports,omitempty" json:"ports,omitempty"` // Volumes is a map containing output folder as a key, and input folder from Docker // as a string value. Volumes *map[string]string `yaml:"volumes,omitempty" json:"volumes,omitempty"` // Environment is a map containing docker environment variable as a key, and // its corresponding service environment name as a value. Environment *map[string]string `yaml:"environment,omitempty" json:"environment,omitempty"` // Capabilities is an array containing all additional Docker capabilities. Capabilities *[]string `yaml:"capabilities,omitempty" json:"capabilities,omitempty"` // Sysctls allows to modify kernel parameters. Sysctls *map[string]string `yaml:"sysctls,omitempty" json:"sysctls,omitempty"` }
type ServiceMethodRelease ¶ added in v0.2.0
type ServiceMethodRelease struct { // Dependencies lists all dependencies needed before running the service. Dependencies *map[string]ServiceDependency `yaml:"dependencies,omitempty" json:"dependencies,omitempty"` }
type ServiceMethodScript ¶ added in v0.1.1
type ServiceMethodScript struct { // Filename is the name of the file to run to start the service. Filename string `yaml:"file" json:"file"` // Clone describes the repository to clone if some files are needed to run the script. Clone *ServiceClone `yaml:"clone,omitempty" json:"clone,omitempty"` // Dependencies lists all dependencies needed before running the service. Dependencies *map[string]ServiceDependency `yaml:"dependencies,omitempty" json:"dependencies,omitempty"` }
type ServiceMethods ¶ added in v0.1.1
type ServiceMethods struct { // Script is a method to launch the service with a shell script. Script *ServiceMethodScript `yaml:"script,omitempty" json:"script,omitempty"` // Release is a method to download and launch the service with // precompiled binaries from GitHub. Release *ServiceMethodRelease `yaml:"release,omitempty" json:"release,omitempty"` // Docker is a method to run the service with Docker. Docker *ServiceMethodDocker `yaml:"docker,omitempty" json:"docker,omitempty"` }
type ServiceUpdate ¶ added in v0.6.0
type ServiceUpdate struct {
Available bool `json:"available"`
}
type ServiceVersioning ¶ added in v0.6.0
type ServiceVersioning struct { // Version of the service format used. Version Version `yaml:"version" json:"version"` }
type Settings ¶ added in v0.5.3
type Settings struct {
Notifications *SettingsNotifications `json:"notifications,omitempty"`
}
type SettingsAdapterPort ¶ added in v0.5.6
type SettingsNotifications ¶ added in v0.5.3
type SettingsNotifications struct {
Webhook *string `json:"webhook,omitempty"`
}
type TempListener ¶ added in v0.1.1
type TempListener struct {
// contains filtered or unexported fields
}
func NewTempListener ¶ added in v0.1.1
func NewTempListener(onEvent func(e interface{})) TempListener
func (TempListener) GetUUID ¶ added in v0.1.1
func (t TempListener) GetUUID() uuid.UUID
func (TempListener) OnEvent ¶ added in v0.1.1
func (t TempListener) OnEvent(e interface{})
type URL ¶ added in v0.1.1
type URL struct { // Name is the name displayed to the used describing this URL. Name string `yaml:"name" json:"name"` // Port is the port where this url is supposed to be. // Note that this port is mapped to the default value of an environment definition if possible, // but the port here doesn't change with the environment. Port string `yaml:"port" json:"port"` // HomeRoute allows to specify a route to change the home path. HomeRoute *string `yaml:"home,omitempty" json:"home,omitempty"` // PingRoute allows to specify a route to change the ping path. PingRoute *string `yaml:"ping,omitempty" json:"ping,omitempty"` // Kind is the type of url. // It can be: client, server. Kind string `yaml:"kind" json:"kind"` }
type WaitContainerCondition ¶ added in v0.9.0
type WaitContainerCondition container.WaitCondition
Click to show internal directories.
Click to hide internal directories.