types

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyUpdating = errors.New("an update is already in progress, cannot start another")
)
View Source
var ErrFailedToFetchBaseline = errors.New("failed to fetch baseline")

Functions

This section is empty.

Types

type About

type About struct {
	Version string `json:"version"`
	Commit  string `json:"commit"`
	Date    string `json:"date"`

	OS   string `json:"os"`
	Arch string `json:"arch"`
}

type AdminSettings added in v0.16.0

type AdminSettings struct {
	ID             uint           `json:"id" db:"id"`
	UpdatesChannel UpdatesChannel `json:"updates_channel,omitempty" db:"updates_channel"`
	Webhook        *string        `json:"webhook,omitempty" db:"webhook"`
	CreatedAt      int64          `json:"created_at" db:"created_at"`
	UpdatedAt      int64          `json:"updated_at" db:"updated_at"`
	DeletedAt      *int64         `json:"deleted_at,omitempty" db:"deleted_at"`
}

type Baseline

type Baseline struct {
	Date           string `json:"date"`            // Date of this release.
	Version        string `json:"version"`         // Public Version of the release.
	Description    string `json:"description"`     // Condensed Description of the release.
	Vertex         string `json:"vertex"`          // Vertex version for this baseline Version.
	VertexClient   string `json:"vertex_client"`   // VertexClient version for this baseline Version.
	VertexServices string `json:"vertex_services"` // VertexServices version for this baseline Version.
}

func (Baseline) GetVersionByID

func (b Baseline) GetVersionByID(id string) (string, error)

type CPU added in v0.16.0

type CPU struct {
	Count      int32    `json:"count,omitempty"`
	VendorID   string   `json:"vendor_id,omitempty"`
	Family     string   `json:"family,omitempty"`
	Model      string   `json:"model,omitempty"`
	Stepping   int32    `json:"stepping,omitempty"`
	PhysicalID string   `json:"physical_id,omitempty"`
	CoreID     string   `json:"core_id,omitempty"`
	CoresCount int32    `json:"cores_count,omitempty"`
	ModelName  string   `json:"model_name,omitempty"`
	Mhz        float64  `json:"mhz,omitempty"`
	CacheSize  int32    `json:"cache_size,omitempty"`
	Flags      []string `json:"flags,omitempty"`
	Microcode  string   `json:"microcode,omitempty"`
}

type CheckResponse added in v0.16.0

type CheckResponse struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Error string `json:"error"`
}

type DB added in v0.16.0

type DB struct {
	*sqlx.DB
}

func (*DB) SetDB added in v0.16.0

func (d *DB) SetDB(db *sqlx.DB)

type DbConfig added in v0.16.0

type DbConfig struct {
	// DbmsName is the database management system name that Vertex will use.
	DbmsName DbmsName `json:"dbms_name" yaml:"dbms_name"`
}

type DbmsName added in v0.16.0

type DbmsName string
const (
	DbmsNameSqlite   DbmsName = "sqlite" // Default
	DbmsNamePostgres DbmsName = "postgres"
)

type EventAllAppsReady added in v0.16.0

type EventAllAppsReady struct{}

EventAllAppsReady is dispatched when all apps are ready to be used.

type EventAppReady

type EventAppReady struct {
	// AppID is the id of the app that is ready.
	AppID string
}

EventAppReady is dispatched when the app with the id AppID is ready to be used.

type EventDbCopy added in v0.16.0

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

EventDbCopy is dispatched when the database is copied. Use this event to send which tables you want to copy to the new database.

func NewEventDbCopy added in v0.16.0

func NewEventDbCopy() EventDbCopy

func (*EventDbCopy) AddTable added in v0.16.0

func (e *EventDbCopy) AddTable(t ...string)

AddTable adds a table to the list of tables that will be copied to the new database. Example usage: e.AddTable(types.User{})

func (*EventDbCopy) All added in v0.16.0

func (e *EventDbCopy) All() []string

All returns all tables that will be copied to the new database.

type EventDbCreate added in v0.16.0

type EventDbCreate struct {
	Db *sqlx.DB
}

EventDbCreate is dispatched when the database is created.

type EventDbMigrate added in v0.16.0

type EventDbMigrate struct {
	Db *sqlx.DB
}

EventDbMigrate is dispatched when the database is migrated. Use this event to migrate the database of your app.

type EventServerHardReset

type EventServerHardReset struct{}

EventServerHardReset is dispatched when the server is hard reset. This is used for testing purposes.

type EventServerSetupCompleted added in v0.16.0

type EventServerSetupCompleted struct{}

EventServerSetupCompleted is dispatched when the server setup is completed.

type EventServerStart

type EventServerStart struct{}

EventServerStart is dispatched when the server is started. This event is dispatched before the setup.

type EventServerStop

type EventServerStop struct{}

EventServerStop is dispatched when the server is stopped.

type EventVertexUpdated

type EventVertexUpdated struct{}

EventVertexUpdated is dispatched when the vertex binary is updated.

type Host

type Host struct {
	Hostname             string `json:"hostname,omitempty"`
	Uptime               uint64 `json:"uptime,omitempty"`
	BootTime             uint64 `json:"boot_time,omitempty"`
	Procs                uint64 `json:"procs,omitempty"`
	OS                   string `json:"os,omitempty"`
	Platform             string `json:"platform,omitempty"`
	PlatformFamily       string `json:"platform_family,omitempty"`
	PlatformVersion      string `json:"platform_version,omitempty"`
	KernelVersion        string `json:"kernel_version,omitempty"`
	KernelArch           string `json:"kernel_arch,omitempty"`
	VirtualizationSystem string `json:"virtualization_system,omitempty"`
	VirtualizationRole   string `json:"virtualization_role,omitempty"`
	HostID               string `json:"host_id,omitempty"`
}

type PublicKey

type PublicKey struct {
	Type              string `json:"type"`
	FingerprintSHA256 string `json:"fingerprint_sha_256"`
	Username          string `json:"username"`
}

type Update

type Update struct {
	Baseline Baseline `json:"baseline"` // Baseline is the set of versions that are available to update to.
	Updating bool     `json:"updating"` // Updating is true if an update is currently in progress.
}

type Updater

type Updater interface {
	CurrentVersion() (string, error)
	Install(version string) error
	IsInstalled() bool
	ID() string
}

type UpdatesChannel added in v0.16.0

type UpdatesChannel string
const (
	UpdatesChannelStable UpdatesChannel = "stable"
	UpdatesChannelBeta   UpdatesChannel = "beta"
)

type VertexContext

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

func NewVertexContext

func NewVertexContext(db *DB) *VertexContext

func (*VertexContext) AddListener

func (c *VertexContext) AddListener(l event.Listener)

func (*VertexContext) Db added in v0.16.0

func (c *VertexContext) Db() *DB

func (*VertexContext) DispatchEvent

func (c *VertexContext) DispatchEvent(e event.Event)

func (*VertexContext) DispatchEventWithErr added in v0.16.0

func (c *VertexContext) DispatchEventWithErr(e event.Event) error

func (*VertexContext) RemoveListener

func (c *VertexContext) RemoveListener(l event.Listener)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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