Documentation ¶
Index ¶
- Variables
- func AreABRootTransactionsLocked() bool
- func AskConfirmation(s string, norm bool) bool
- func CheckConnection() bool
- func ConfirmWindow(title string, body string) bool
- func CreateVsoTable(writer io.Writer) *tablewriter.Table
- func DeleteTaskByUnitName(name string) error
- func EnsureWayStarted() error
- func FetchPackage(match FdroidPackage) (string, error)
- func GetBatteryStats() (bool, bool, bool)
- func GetCPUTemp() int
- func GetPackageVersion(pkg FdroidPackage) (string, error)
- func GetPico() (*core.SubSystem, error)
- func GetRepos() error
- func GetWay() (*core.SubSystem, error)
- func GetWayDatabase() (*bolt.DB, error)
- func HasUpdates() (bool, error)
- func IsCPUUnderHighUsage() (bool, int)
- func IsInternetUnderHighUsage() (bool, int)
- func IsLaptop() bool
- func IsMemoryUnderHighUsage() (bool, int)
- func IsMeteredConnection() bool
- func IsNetworkUp() bool
- func IsSupported() int
- func ItsBeen(last time.Time, duration string) bool
- func ItsTime(targetTime string) bool
- func ListTasksJson() (string, error)
- func ListUnitTasks() ([]string, error)
- func NeedUpdate() bool
- func PickOption(s string, a []string, def int) int
- func PicoDelete() error
- func PicoExists() bool
- func PicoExport(app string, binary string) error
- func PicoInit() error
- func PicoUnexport(app string, binary string) error
- func PicoUpgrade() error
- func RootCheck(display bool) bool
- func RotateTasks(event string) error
- func RunTaskByUnitName(name string) error
- func RunUpgradeCheck() error
- func RunUpgradeCheckJSON() (bool, error)
- func SendNotification(title, body string) error
- func SmartUpdate() bool
- func SyncIndex(force bool, downTrans string) error
- func TaskHasRun(name string) bool
- func TaskHasRunFail(name string) bool
- func TaskHasRunSuccess(name string) bool
- func TasksInit() error
- func TryUpdate(force bool) error
- func WayDelete() error
- func WayExists() bool
- func WayInit() error
- func WayLXCStart() error
- func WayLXCStop() error
- func WayPutAppIntoDatabase(pkg FdroidPackage, db *bolt.DB) error
- func WayRemoveAppFromDatabase(rdnsname string, db *bolt.DB) error
- func WaySessionStart() error
- type BucketNotFoundError
- type CommonChecks
- type FdroidPackage
- type FdroidRepo
- type InstallDeclined
- type NoMatchError
- type PackageInCache
- type Task
- func (t *Task) Delete() error
- func (t *Task) Dependencies() []Task
- func (t *Task) IsRunning() bool
- func (t *Task) Relations() []Task
- func (t *Task) RemoveLastFailure() error
- func (t *Task) RemoveLastSuccess() error
- func (t *Task) RemoveRunning() error
- func (t *Task) Run() error
- func (t *Task) Save() error
- func (t *Task) SaveLastFailure() error
- func (t *Task) SaveLastSuccess() error
- func (t *Task) SaveRunning() error
- func (t *Task) ShouldRun(cChecks *CommonChecks, event string) bool
- func (t *Task) Target() string
- func (t *Task) Unit() string
- func (t *Task) WasFailure() bool
- func (t *Task) WasSuccessful() bool
- type TaskJson
Constants ¶
This section is empty.
Variables ¶
var ( TasksLocation = "/.config/vso/tasks" CurrentQueue = []Task{} )
var APKCacheDir = fmt.Sprintf("%s/.cache/vso/apks/", os.Getenv("HOME"))
var DatabasePath = fmt.Sprintf("%s/.local/share/vso/waydroid/droidapps.db", os.Getenv("HOME"))
var IndexCacheDir = fmt.Sprintf("%s/.cache/vso/indexes/", os.Getenv("HOME"))
var Indexes []os.DirEntry
var ProcessPath string
var Repositories []FdroidRepo
Functions ¶
func AreABRootTransactionsLocked ¶
func AreABRootTransactionsLocked() bool
AreABRootTransactionsLocked checks if there are any abroot transactions currently running
func AskConfirmation ¶
func CheckConnection ¶
func CheckConnection() bool
func ConfirmWindow ¶
func CreateVsoTable ¶
func CreateVsoTable(writer io.Writer) *tablewriter.Table
func DeleteTaskByUnitName ¶
DeleteTaskByUnitName deletes a task
func EnsureWayStarted ¶
func EnsureWayStarted() error
func FetchPackage ¶
func FetchPackage(match FdroidPackage) (string, error)
func GetBatteryStats ¶
GetBatteryStats gets the battery stats
func GetPackageVersion ¶
func GetPackageVersion(pkg FdroidPackage) (string, error)
func GetWayDatabase ¶
func HasUpdates ¶
HasUpdates checks if the system has updates available
func IsCPUUnderHighUsage ¶
IsCPUUnderHighUsage checks if the CPU is being used (false if exceeds 50%)
func IsInternetUnderHighUsage ¶
IsInternetUnderHighUsage checks if the internet is being used (false if exceeds 500kb/s)
func IsLaptop ¶
func IsLaptop() bool
IsLaptop checks if the system is a laptop by looking for the chassis type
func IsMemoryUnderHighUsage ¶
IsMemoryUnderHighUsage checks if the memory is being used (false if exceeds 50%)
func IsMeteredConnection ¶
func IsMeteredConnection() bool
IsMeteredConnection checks if the connection is metered
func IsSupported ¶
func IsSupported() int
func ListTasksJson ¶
ListTasksJson lists all tasks with detailed information in JSON format
func NeedUpdate ¶
func NeedUpdate() bool
NeedUpdate checks if the system needs to be updated according to the latest update log compared to the VSO configuation
func PicoDelete ¶
func PicoDelete() error
func PicoExists ¶
func PicoExists() bool
func PicoExport ¶
func PicoUnexport ¶
func PicoUpgrade ¶
func PicoUpgrade() error
func RotateTasks ¶
RotateTasks checks if no other rotators are running, then performs initial checks and starts rotating every 5 seconds
func RunUpgradeCheck ¶
func RunUpgradeCheck() error
RunUpgradeCheck asks ABRoot to check for updates and passes its output to stdout
func RunUpgradeCheckJSON ¶
RunUpgradeCheckJSON asks ABRoot to check for updates and return a JSON-formatted result
func SendNotification ¶
func SmartUpdate ¶
func SmartUpdate() bool
SmartUpdate checks if the device is currently being used, then returns true if the device is not being used
func TaskHasRun ¶
TaskHasRun checks if a task has run in the current queue
func TaskHasRunFail ¶
TaskHasRunFail checks if a task has run unsuccessfully in the current queue
func TaskHasRunSuccess ¶
TaskHasRunSuccess checks if a task has run successfully in the current queue
func TasksInit ¶
func TasksInit() error
TasksInit calls makeTasksLocation and makeTasksRotatorAutostart in one call
func WayLXCStart ¶
func WayLXCStart() error
func WayLXCStop ¶
func WayLXCStop() error
func WayPutAppIntoDatabase ¶
func WayPutAppIntoDatabase(pkg FdroidPackage, db *bolt.DB) error
func WaySessionStart ¶
func WaySessionStart() error
Types ¶
type BucketNotFoundError ¶
func (*BucketNotFoundError) Error ¶
func (b *BucketNotFoundError) Error() string
type CommonChecks ¶
type CommonChecks struct { Network bool Battery bool LowBattery bool FullBattery bool IsLaptop bool HighInternetUsage bool InternetUsage int MeteredConnection bool HighMemoryUsage bool MemoryUsage int HighCPUUsage bool CPUUsage int CPUTemp int }
func GetCommonChecks ¶
func GetCommonChecks() *CommonChecks
GetCommonChecks checks network and battery
type FdroidPackage ¶
type FdroidPackage struct { Name string RDNSName string Summary string Author string Source string License string InstalledVersionCode int Repository FdroidRepo Versions []byte }
func SearchIndex ¶
func SearchIndex(search string, downTrans string) ([]FdroidPackage, error)
func WayGetAppFromDatabase ¶
func WayGetAppFromDatabase(rdnsname string, db *bolt.DB) (FdroidPackage, error)
type FdroidRepo ¶
type InstallDeclined ¶
type InstallDeclined struct{}
func (*InstallDeclined) Error ¶
func (i *InstallDeclined) Error() string
type NoMatchError ¶
func (*NoMatchError) Error ¶
func (n *NoMatchError) Error() string
type PackageInCache ¶
func (*PackageInCache) Error ¶
func (p *PackageInCache) Error() string
type Task ¶
type Task struct { Name string Slug string Description string NeedConfirm bool Command string AfterTask string AfterTaskSuccess string AfterTaskFailure string Every string At string //OnBoot bool OnNetwork bool OnDisconnect bool OnBattery bool OnLowBattery bool OnCharge bool OnFullBattery bool OnConditionCommand string OnProcess string OnInternetUsage int OnHighInternetUsage bool OnMemoryUsage int OnHighMemoryUsage bool OnCPUUsage int OnHighCPUUsage bool OnCPUTemp int OnDeviceConnected string OnDeviceDisconnected string LastExecution time.Time LastExecutionOutput string }
func ListTasksDetailed ¶
ListTasksDetailed lists all tasks with detailed information
func LoadTaskByUnitName ¶
LoadTaskByUnitName loads a task
func (*Task) Dependencies ¶
Dependencies returns a list of Task which the current one depends on
func (*Task) RemoveLastFailure ¶
RemoveLastFailure removes the last failure of a task in /tmp
func (*Task) RemoveLastSuccess ¶
RemoveLastSuccess removes the last success of a task in /tmp
func (*Task) RemoveRunning ¶
RemoveRunning removes the running state of a task in /tmp
func (*Task) SaveLastFailure ¶
SaveLastFailure saves the last failure of a task in /tmp
func (*Task) SaveLastSuccess ¶
SaveLastSuccess saves the last success of a task in /tmp
func (*Task) SaveRunning ¶
SaveRunning saves the running state of a task in /tmp
func (*Task) ShouldRun ¶
func (t *Task) ShouldRun(cChecks *CommonChecks, event string) bool
ShouldRun checks if a task respect the assigned event/condition
func (*Task) WasFailure ¶
WasFailure checks if a task was a failure
func (*Task) WasSuccessful ¶
WasSuccessful checks if a task was successful