utils

package
v0.0.0-...-3d72aec Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: LGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Online = iota
	Offline
)

Variables

This section is empty.

Functions

func ForceExit

func ForceExit()

func GoID

func GoID() int

func InterfaceToInt

func InterfaceToInt(v interface{}) (out int, err error)

func InterfaceToString

func InterfaceToString(v interface{}) (out string, err error)

func IsFileExists

func IsFileExists(filename string) bool

func LoadBinaryFromFile

func LoadBinaryFromFile(fname string) ([]byte, error)

func LoadImageFromFile

func LoadImageFromFile(fname string) (image.Image, error)

func LoadJSONFromFile

func LoadJSONFromFile(fname string, obj interface{}) error

func MakeFullDir

func MakeFullDir(p string) error

func ProjectRoot

func ProjectRoot() string

func Reboot

func Reboot() error

func SearchUpFile

func SearchUpFile(base string, filename string) (fullpath string, err error)

func SetSystemDate

func SetSystemDate(newTime time.Time) error

func UserHome

func UserHome() (string, error)

func ValidFileName

func ValidFileName(fname string) bool

func WindowsSystemDrive

func WindowsSystemDrive() string

Types

type Alive

type Alive struct {
	// contains filtered or unexported fields
}

func NewAlive

func NewAlive(max_idle time.Duration) *Alive

func (*Alive) AliveInfo

func (s *Alive) AliveInfo() (alive bool, tBegin time.Time, tLast time.Time)

func (*Alive) Update

func (s *Alive) Update()

Jump to

Keyboard shortcuts

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