updater

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Available

func Available(configDir string) bool

func BackupData

func BackupData(configDir, updateDir, backupDir string) error

func ClearUpdates

func ClearUpdates(configDir string) error

func CopyFile

func CopyFile(in, out string) error

func DisablePlugins

func DisablePlugins(configDir string, pname []string) error

func EnablePlugins

func EnablePlugins(configDir string, pname []string) error

func GetReadme

func GetReadme(configDir string, pluginName string) (io.ReadCloser, error)

func ListPlugins

func ListPlugins(configDir string) (map[string]*assets.Plugin, error)

Lists ALL plugins (including those that are not active, and those that are currently pending restart)

func ModifyConfigFile

func ModifyConfigFile(configDir string, c *assets.Configuration) error

func OverwriteFile

func OverwriteFile(in, out string) error

func ReadConfig

func ReadConfig(configDir string) (*assets.Configuration, error)

func ReadConfigFile

func ReadConfigFile(configDir string) ([]byte, error)

func RemovePlugins

func RemovePlugins(configDir, updateDir, backupDir string, plugins []string) error

func ReplaceOrStart

func ReplaceOrStart(heedyPath string, args ...string) error

func ReplaceProcess

func ReplaceProcess(heedyPath string, args ...string) error
ReplaceProcess replaces the current process with the one given. It only works on unix

so it will fail with an error on Windows.

func Revert

func Revert(configDir string, failure error) error

func RevertConfig

func RevertConfig(configDir, backupDir, revertDir string) error

func RevertData

func RevertData(configDir, backupDir, revertDir string) error

func RevertHeedy

func RevertHeedy(configDir, backupDir, revertDir string) error

RevertHeedy reverts the heedy executable to the backed up version if such exists

func RevertPlugins

func RevertPlugins(configDir, backupDir, revertDir string) error

func Run

func Run(o Options) error

func SetConfigFile

func SetConfigFile(configDir string, b []byte) error

func ShiftFiles

func ShiftFiles(in, middle, out string) error

ShiftFiles moves middle->out (if exists), and then in->middle

func StartHeedy

func StartHeedy(configDir string, replace bool, extraArgs ...string) error

StartHeedy starts the heedy server set up for the given database. If replace is true, it tries to replace the current process with the new one, if not, or if replacement is not supported, it starts the new process in the background.

func StartProcess

func StartProcess(heedyPath string, args ...string) error

StartProcess starts the given process in the background, and releases it, so that closing the current process doesn't close the child.

func Status

func Status(configDir string) error

func UnzipDirectory

func UnzipDirectory(src string, dest string) error

UnzipDirectory will decompress a zip archive, moving all files and folders within the zip file (parameter 1) to an output directory (parameter 2). https://golangcode.com/unzip-files-in-go/

func Update

func Update(configDir string) (bool, error)

func UpdateConfig

func UpdateConfig(configDir, updateDir, backupDir string) error

func UpdateHeedy

func UpdateHeedy(configDir, updateDir, backupDir string) error

UpdateHeedy updates the heedy executable

func UpdatePlugin

func UpdatePlugin(configDir string, zipFile string) error

func UpdatePlugins

func UpdatePlugins(configDir, updateDir, backupDir string) error

UpdatePlugins updates all the plugins

func WriteOptions

func WriteOptions(configDir string, o *UpdateOptions) error

func ZipDirectory

func ZipDirectory(zipFile, inputDir string) error

Types

type Options

type Options struct {
	ConfigDir   string
	AddonConfig *assets.Configuration
	Runner      func(a *assets.Assets) error
	Revert      bool
	Update      bool
}

type UpdateInfo

type UpdateInfo struct {
	Heedy   bool           `json:"heedy"`
	Config  bool           `json:"config"`
	Plugins []string       `json:"plugins"`
	Options *UpdateOptions `json:"options"`
}

func GetInfo

func GetInfo(configDir string) (ui UpdateInfo, err error)

type UpdateOptions

type UpdateOptions struct {
	BackupData     bool     `json:"backup"`
	DeletedPlugins []string `json:"deleted"`
}

func ReadOptions

func ReadOptions(configDir string) (*UpdateOptions, error)

Jump to

Keyboard shortcuts

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