ludos

package
v0.14.6 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package ludos encapsulates logic used in LudOS, the Operating System version of Ludo. Here Ludo is used as a Desktop Environment and can perform actions like rebooting the system or enabling a daemon.

Index

Constants

View Source
const UpdatesDir = "/storage/.update/"

UpdatesDir is where releases should be saved to

Variables

This section is empty.

Functions

func ConnectNetwork

func ConnectNetwork(network Network, passphrase string) error

ConnectNetwork attempt to establish a connection to the given network

func DownloadRelease

func DownloadRelease(path, url string)

DownloadRelease will download a LudOS release from github

func GetProgress

func GetProgress() float64

GetProgress returns the download progress

func GetReleases

func GetReleases() (*[]GHRelease, error)

GetReleases will get and decode the json from github api, and return the list of LudOS releases

func InitializeServiceSettingsValues

func InitializeServiceSettingsValues(fields []*structs.Field)

InitializeServiceSettingsValues is called after settings.yml is loaded. It sets the values of SSHService, SambaService and BluetoothService that don't depend on settings.yml but on the presence of files in the system.

func IsDone

func IsDone() bool

IsDone returns true when the download is finished

func IsDownloading

func IsDownloading() bool

IsDownloading returns true if the updater is currently downloading a release

func NetworkStatus

func NetworkStatus(network Network) string

NetworkStatus returns the status of a network

func ServiceSettingIncrCallback

func ServiceSettingIncrCallback(f *structs.Field, direction int)

ServiceSettingIncrCallback is executed when a service settings is toggled. It enables or disables the daemon corresponding to the current setting field.

func SystemdServiceToggle

func SystemdServiceToggle(path string, serviceName string, enable bool) error

SystemdServiceToggle can enable and start, or disable and stop a systemd service in LudOS.

Types

type GHAsset

type GHAsset struct {
	Name               string
	BrowserDownloadURL string `json:"browser_download_url"`
}

GHAsset is an asset attached to a github release

func FilterAssets

func FilterAssets(assets []GHAsset) *GHAsset

FilterAssets finds and return the asset matching the LIBREELEC_ARCH

type GHRelease

type GHRelease struct {
	Name   string
	Assets []GHAsset
}

GHRelease is a LudOS release hosted on github

type Network

type Network struct {
	SSID string
	Path string
}

Network is a network as detected by connman

var CurrentNetwork Network

CurrentNetwork is the network we're connected to

func ScanNetworks

func ScanNetworks() ([]Network, error)

ScanNetworks enables connman and returns the list of available SSIDs

Jump to

Keyboard shortcuts

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