Documentation ¶
Index ¶
- Constants
- func CopyDir(src string, dst string) (err error)
- func CopyFile(src string, dst string) (n int64, err error)
- func GetLocalIPList() (list []string, err error)
- func MustEncodeGob(v interface{}) []byte
- func MustEncodeJSON(v interface{}) []byte
- func NormalizePathname(pathname string) string
- func ParseBytes(s string) (int64, error)
- func ParseGobFile(filename string, v interface{}) (err error)
- func ParseJSONFile(filename string, v interface{}) (err error)
- func SplitByFirstByte(s string, c byte) (string, string)
- func SplitByLastByte(s string, c byte) (string, string)
- func ToNumber(v any) (f float64, err error)
- func WaitForExitSignal(callback func(os.Signal) bool)
- func WriteGobFile(filename string, v interface{}) (err error)
- func WriteJSONFile(filename string, v interface{}, indent string) (err error)
- func Zip(path string, w io.Writer) error
Constants ¶
View Source
const ( B int64 = 1 << (10 * iota) KB MB GB TB PB )
Variables ¶
This section is empty.
Functions ¶
func GetLocalIPList ¶ added in v0.1.1
GetLocalIPList return the list of local ip address.
func MustEncodeGob ¶
func MustEncodeGob(v interface{}) []byte
func MustEncodeJSON ¶ added in v0.5.5
func MustEncodeJSON(v interface{}) []byte
func NormalizePathname ¶ added in v0.9.0
NormalizePathname is the URL version of path.Clean, it returns a canonical URL path for p, eliminating . and .. elements.
The following rules are applied iteratively until no further processing can be done:
- Replace multiple slashes with a single slash.
- Eliminate each . path name element (the current directory).
- Eliminate each inner .. path name element (the parent directory) along with the non-.. element that precedes it.
- Eliminate .. elements that begin a rooted path: that is, replace "/.." by "/" at the beginning of a path.
If the result of this process is an empty string, "/" is returned
func ParseGobFile ¶
func ParseJSONFile ¶
func SplitByFirstByte ¶
SplitByFirstByte splits string by a char from the beginning.
func SplitByLastByte ¶
SplitByLastByte splits string by a char from the end.
func WaitForExitSignal ¶ added in v0.6.3
WaitForExitSignal waits for the exit signal.
func WriteGobFile ¶ added in v0.1.1
func WriteJSONFile ¶ added in v0.1.1
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.