common

package
v0.0.0-...-b320325 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

README

Common functionality used by "service" and "cli_client"

The folder hold consts, data and functions, which are used by both, the cli_client and the service. It should not hold functionality used by the webclient, in order to avoid using huge packages like "fmt". Functionality shared with the web_client has to be stored in the folder "common_web".

Documentation

Index

Constants

View Source
const (
	PATH_ROOT                   = "/usr/local/P4wnP1"
	PATH_KEYBOARD_LANGUAGE_MAPS = PATH_ROOT + "/keymaps"
	PATH_WEBROOT                = PATH_ROOT + "/www"
	PATH_BASH_SCRIPTS           = PATH_ROOT + "/scripts"
	PATH_HID_SCRIPTS            = PATH_ROOT + "/HIDScripts"
	PATH_DATA_STORE             = PATH_ROOT + "/store"
	PATH_DATA_STORE_BACKUP      = PATH_ROOT + "/db"
	PATH_IMAGE_CDROM            = PATH_ROOT + "/ums/cdrom"
	PATH_IMAGE_FLASHDRIVE       = PATH_ROOT + "/ums/flashdrive"
)

Variables

This section is empty.

Functions

func ReadFile

func ReadFile(path string, start int64, chunk []byte, perm os.FileMode) (n int, err error)

func RunBashScript

func RunBashScript(scriptPath string) (err error)

func RunBashScriptEnv

func RunBashScriptEnv(scriptPath string, env ...string) (err error)

func WriteFile

func WriteFile(path string, mustNotExist bool, append bool, data []byte, perm os.FileMode) error

Types

type LogWriter

type LogWriter struct {
	Prefix string
}

func (LogWriter) Write

func (lw LogWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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