updater

package
v0.4.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2020 License: Apache-2.0 Imports: 12 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 CopyFile

func CopyFile(in, out 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(a *assets.Assets) (*assets.Configuration, error)

func ReadConfigFile

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

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 RunHeedy

func RunHeedy(configDir string, extraArgs ...string) 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 StartProcess

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

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 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
}

type UpdateInfo

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

func GetInfo

func GetInfo(configDir string) (ui UpdateInfo)

Jump to

Keyboard shortcuts

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