sys

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sys

type Sys struct {
	// The path of the current executable.
	ExecutablePath string
	Driver         database.Driver
	// contains filtered or unexported fields
}

Sys defines the base and core functionality for Verbis, such as restarting and updating the system.

func New

func New(db database.Driver) *Sys

New creates a new system type, used for restarting and manipulating the system.

func (*Sys) HasUpdate

func (s *Sys) HasUpdate() bool

HasUpdate determines if there is an update available from GitHub. The function panics if it encountered and error obtaining the version.

func (*Sys) LatestVersion

func (s *Sys) LatestVersion() string

LatestVersion obtains the latest remote version from Github. The function panics if it encountered and error obtaining the version.

func (*Sys) Restart

func (s *Sys) Restart() error

Restart stops the currently running process and restarts the executable with the original os arguments.

func (*Sys) Update

func (s *Sys) Update() (string, error)

Update updates the Verbis executable and runs any DB migrations. It calls Restart() upon a successful update.

Returns errors.INVALID if Verbis is already up to date. Returns errors.INTERNAL if it could not be updated.

type System

type System interface {
	Restart() error
	Update() (string, error)
	LatestVersion() string
	HasUpdate() bool
}

System represents cor functions for interacting with Verbis.

Jump to

Keyboard shortcuts

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