Documentation
¶
Index ¶
- Variables
- func ByteSize(bytes uint64) string
- func BytesToString(b []byte) string
- func CopyBytes(b []byte) []byte
- func CopyString(s string) string
- func ReadFile(path string, fs http.FileSystem) ([]byte, error)
- func SaveFile(fh *multipart.FileHeader, path string) (err error)
- func StartTimeStampUpdater()
- func StringToBytes(s string) []byte
- func ToString(arg interface{}, timeFormat ...string) string
- func UnsafeBytes(s string) (bs []byte)
- func UnsafeString(b []byte) string
- func Walk(fs http.FileSystem, root string, walkFn filepath.WalkFunc) error
Constants ¶
This section is empty.
Variables ¶
var ( // Timestamp please start the timer function before you use this value // please load the value with atomic `atomic.LoadUint32(&utils.Timestamp)` Timestamp uint32 )
Functions ¶
func ByteSize ¶
ByteSize returns a human-readable byte string of the form 10M, 12.5K, and so forth. The unit that results in the smallest number greater than or equal to 1 is always chosen.
func BytesToString ¶ added in v1.0.8
BytesToString converts byte slice to string without a memory allocation.
func ReadFile ¶ added in v1.0.8
func ReadFile(path string, fs http.FileSystem) ([]byte, error)
#nosec G304 ReadFile returns the raw content of a file
func StartTimeStampUpdater ¶
func StartTimeStampUpdater()
StartTimeStampUpdater starts a concurrent function which stores the timestamp to an atomic value per second, which is much better for performance than determining it at runtime each time
func StringToBytes ¶ added in v1.0.8
StringToBytes converts string to byte slice without a memory allocation.
func UnsafeBytes ¶
#nosec G103 UnsafeBytes returns a byte pointer without allocation
func UnsafeString ¶
#nosec G103 UnsafeString returns a string pointer without allocation
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
The `fwd` package provides a buffered reader and writer.
|
The `fwd` package provides a buffered reader and writer. |
|
This package is the support library for the msgp code generator (http://github.com/tinylib/msgp).
|
This package is the support library for the msgp code generator (http://github.com/tinylib/msgp). |
|
Package xid is a globally unique id generator suited for web scale
|
Package xid is a globally unique id generator suited for web scale |