utils

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chdir

func Chdir(path string)

func CheckError

func CheckError(err error, msg ...interface{})

func ClearScreen

func ClearScreen(Os string)

func CreateFile added in v0.1.3

func CreateFile(filepath string)

func Err added in v0.1.3

func Err(msg string)

func FrecencyScore added in v0.1.5

func FrecencyScore(hits, age int64) int64

age= current unix timestamp(in sec) - last accessed frecency_score= 1000*hits*e^(-lambda*age) each hits worth 1000 points

func GetAbsPathSlice added in v0.1.5

func GetAbsPathSlice(root string, paths []string) []string

func GetNonDotDirs

func GetNonDotDirs(dirs []string) []string

func GetOs

func GetOs() string

func GetTerminalHeight

func GetTerminalHeight() int

func HomeDir added in v0.1.3

func HomeDir() string

func Info added in v0.1.3

func Info(msg string)

func IsDotFile

func IsDotFile(filename string) bool

func IsKeyboardInterrupt

func IsKeyboardInterrupt(err error) bool

func Lambda added in v0.1.5

func Lambda() float64

half-life decay => lambda = ln2/decay_time

func PathExists

func PathExists(path string) bool

func PathIsDir

func PathIsDir(path string) bool

func PathIsFile

func PathIsFile(path string) bool
func PathIsLink(path string) bool

func ReadYamlFile added in v0.1.3

func ReadYamlFile(filepath string, store *interface{})

func Remove added in v0.1.5

func Remove(s []string, i int) []string
func ResolveLink(path string) string

func Warn added in v0.1.3

func Warn(msg string)

func WriteToFile

func WriteToFile(filepath, data string)

func WriteYamlFile added in v0.1.3

func WriteYamlFile(filepath string, data interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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