util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BrotliDecode

func BrotliDecode(buf []byte) ([]byte, error)

BrotliDecode brotli解压

func BrotliEncode

func BrotliEncode(buf []byte, quality int) ([]byte, error)

BrotliEncode brotli压缩

func CheckAndGetValueFromEnv

func CheckAndGetValueFromEnv(value string) (result string)

CheckAndGetValueFromEnv 检查并从env中获取值

func GetHeaderValue

func GetHeaderValue(header http.Header, name string) (value []string)

GetHeaderValue 获取 http header的值

func GetHumanReadableSize

func GetHumanReadableSize(size int) string

GetHumanReadableSize 获取便于阅读的数据大小

func GetIdentity

func GetIdentity(req *http.Request) []byte

GetIdentity 获取该请求对应的标识

func GetRewriteRegexp

func GetRewriteRegexp(rewrites []string) map[*regexp.Regexp]string

GetRewriteRegexp 获取rewrite的正式匹配表

func GetTimeConsuming

func GetTimeConsuming(startedAt time.Time) int

GetTimeConsuming 获取使用耗时(ms)

func Gunzip

func Gunzip(buf []byte) ([]byte, error)

Gunzip 解压数据

func Gzip

func Gzip(buf []byte, level int) ([]byte, error)

Gzip 对数据压缩

Types

This section is empty.

Jump to

Keyboard shortcuts

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