Documentation ¶
Index ¶
- func DumpRequest(req *http.Request)
- func DumpResponse(resp *http.Response)
- func GetFileHash(path string) (string, error)
- func NoCache(h http.Handler) http.Handler
- func ParseFileSize(s string) (int64, error)
- func SanitizePathString(s string) (output string)
- func SetURLParam(in string, key string, value string) string
- func TrimStringAsBytes(s string, maxLength int) string
- func TrimStringAsRunes(numChars uint, s string, trimFront bool) string
- func ZipFiles(writer io.Writer, opts ZipOptions) (err error)
- type ZipOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpRequest ¶
func DumpResponse ¶
func GetFileHash ¶
GetFileHash returns the hex encoding of the sha-256 hash of the file at the specified path.
func ParseFileSize ¶
ParseFileSize converts a string contains a positive integer and an optional KB/MB/GB unit to int64, or returns error.
func SanitizePathString ¶
func TrimStringAsBytes ¶
func TrimStringAsRunes ¶
Trim string to numChars: we only care about the number of runes (encoded characters of variable bytes) so we don't cut up multibyte characters
Types ¶
type ZipOptions ¶
type ZipOptions struct { // The search patterns for the files / directories to be zipped, keyed to the // directory prefix used for storing the associated files in the ZIP, // The search pattern is described at the comments of path/filepath.Match. // As a special note, "**/*" doesn't match files not under a subdirectory. Globs map[string]string // The limit of total bytes of all the files in the archive. // All remaining files will be ignored if the limit would be hit. MaxBytes int64 }
ZipOptions is a set of options for ZipFiles.
Click to show internal directories.
Click to hide internal directories.