utils

package
v0.0.0-...-cf10193 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decode

func Base64Decode(data string) ([]byte, error)

func Base64Encode

func Base64Encode(data []byte) string

func BasePath

func BasePath(path string) string

func CleanPath

func CleanPath(path string) string

func Copy

func Copy(srcPath, path string) error

func Dirname

func Dirname(path string) string

func Dumps

func Dumps(file *os.File, data []byte) error

func Error

func Error(err string) error

func Exists

func Exists(path string) bool

func Ext

func Ext(path string) string

func Format

func Format(formatStr string, args ...interface{}) string

func JoinPath

func JoinPath(paths ...string) string

func JsonDump

func JsonDump(i interface{}) string

func JsonLoad

func JsonLoad(data []byte, v interface{})

func Loads

func Loads(file *os.File) ([]byte, error)

func Now

func Now() float64

func Outpath

func Outpath(distPath, Url string) string

func ParseRange

func ParseRange(rangeStr string) (uint64, uint64)

func Printf

func Printf(format string, args ...interface{})

func Println

func Println(str string)

func ResourceDir

func ResourceDir(path string) string

func ResourceName

func ResourceName(path string) string

func ResourcePath

func ResourcePath(path string) string

func Size

func Size(httpClient *http.Client, url string) (int64, error)

Types

type DownInfo

type DownInfo struct {
	Output  string `json: output`
	Chunks  int64  `json: chunks`
	Avaible int64  `json: avaible`
	Size    int64  `json: size`
	DSize   int64  `json: dsize`
	Speed   Speed  `json: speed`
}

func (*DownInfo) String

func (d *DownInfo) String() string

type Info

type Info struct {
	Key     string  `json: key`
	Url     string  `json: url`
	Length  int64   `json: length`
	DownLen int64   `json: downLen`
	Scale   float64 `json: scale`
	Error   string  `json: error`
	Start   int64   `json: start`
	End     int64   `json: end`
	Status  int64   `json: status`
	Output  string  `json: output`
	Retry   int64   `json: retry`
}

func (Info) String

func (info Info) String() string

type Speed

type Speed struct {
	NTotal int64   `json: nTotal`
	LTotal int64   `lTotal`
	Now    float64 `json: now`
	Last   float64 `json: last`
	Val    string  `json: val`
}

func (*Speed) String

func (s *Speed) String() string

func (*Speed) Update

func (s *Speed) Update(total int64)

Jump to

Keyboard shortcuts

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