utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertFile

func CertFile()

func CopyFile

func CopyFile(src string, dst string) error

func CreateDirIfNotExisted

func CreateDirIfNotExisted()

CreateDirIfNotExisted creates the quics folder if it does not exist

func GetDownloadDirPath

func GetDownloadDirPath() string

get conflict dir path

func GetEmptyFilePath

func GetEmptyFilePath() string

get new emptyfile in quicsDir, if not exist then create new emptyfile

func GetQuicsDirPath

func GetQuicsDirPath() string

GetQuicsDirPath returns the path of the quics folder

func GetQuicsTempDirPath

func GetQuicsTempDirPath() string

get temp dir path

func InitJobList

func InitJobList()

func LocalAbsToRoot

func LocalAbsToRoot(abs string, root string) string

LocalAbsToRoot converts an absolute path to a relative path to the root ex) LocalAbsToRoot("/a/rootDir/c", "/a/rootDir") -> "/rootDir/c"

func LocalRelToRoot

func LocalRelToRoot(rel string, root string) string

LocalRelToRoot converts a relative path to a relative path to the root ex) LocalRelToRoot("./b/c", "a/b") -> "/c"

func MakeHash

func MakeHash(after string, info os.FileInfo) string

func ReadEnvFile

func ReadEnvFile() []string

Types

type JPriority

type JPriority string
const (
	Urgent JPriority = "URGENT"
	High   JPriority = "HIGH"
	Medium JPriority = "MEDIUM"
	Low    JPriority = "LOW"
)

type JStatus

type JStatus string
const (
	Ready   JStatus = "READY"
	Working JStatus = "WORKING"
	Done    JStatus = "DONE"
)

type JType

type JType string
const (
	ConnectServer    JType = "CONNECT_SERVER"
	ConnectRoot      JType = "CONNECT_ROOT"
	DisconnectServer JType = "DISCONNECT_SERVER"
	Rescan           JType = "RESCAN"
	ShowStatus       JType = "SHOW_STATUS"
	ChooseOne        JType = "CHOOSE_ONE"
)

type Job

type Job struct {
	JobID    string
	Type     JType
	Status   JStatus
	Priority JPriority

	Path string // which task
	Do   func() // allow any function
	// contains filtered or unexported fields
}

func (*Job) Decode

func (j *Job) Decode(data []byte)

func (*Job) Encode

func (j *Job) Encode() []byte

type JobList

type JobList struct {
	// contains filtered or unexported fields
}
var JList *JobList

func (*JobList) MoveJobAToB

func (JList *JobList) MoveJobAToB(path string, jp_a JPriority, jp_b JPriority) error

func (*JobList) PopJob

func (JList *JobList) PopJob(jp JPriority) (*Job, error)

func (*JobList) PrintJobList

func (JList *JobList) PrintJobList()

func (*JobList) PushJob

func (JList *JobList) PushJob(jp JPriority, jt JType, path string, do func()) error

type ViperConfig

type ViperConfig struct {
	Key   string
	Value string
}

Jump to

Keyboard shortcuts

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