Documentation ¶
Index ¶
- Variables
- func AppendPaddingUint(dst []byte, n, p int, c byte) []byte
- func AppendQueryString(dst, qstr []byte) []byte
- func AppendSpacePaddingUint(dst []byte, n, p int) []byte
- func AppendZeroPaddingUint(dst []byte, n, p int) []byte
- func Bytes2dEqual(a, b [][]byte) bool
- func CopyPaddingRightUint(dst []byte, n, p int, c byte) (offset int)
- func CopyRightUint(dst []byte, n int) (offset int)
- func IsHttpOrHttps(uri []byte) bool
- func IsHttpStatusRedirect(status int) bool
- func SplitRequestURI(uri []byte) ([]byte, []byte)
- type Cache
- type CacheKey
- type Strftime
- type StringList
- type StringSet
Constants ¶
This section is empty.
Variables ¶
var ( HttpProtocol = []byte("http://") HttpsProtocol = []byte("https://") )
Functions ¶
func AppendPaddingUint ¶ added in v0.0.2
AppendPaddingUint appends n with c padding that size of p to dst and returns the extended dst.
func AppendQueryString ¶
AppendQueryString appends qstr to dst.
func AppendSpacePaddingUint ¶ added in v0.0.2
AppendSpacePaddingUint appends n with space padding that size of p to dst and returns the extended dst.
func AppendZeroPaddingUint ¶
AppendZeroPaddingUint appends n with zero padding that size of p to dst and returns the extended dst.
func Bytes2dEqual ¶ added in v0.3.6
Bytes2dEqual reports whether a and b are the same length and contain the same two dimensional (2d) bytes.
func CopyPaddingRightUint ¶ added in v0.3.4
CopyPaddingRightUint copies n with c padding that size of p to the right side of dst, and returns coppied offset of dst.
func CopyRightUint ¶ added in v0.3.4
CopyRightUint copies n to the right side of dst.
func IsHttpOrHttps ¶
func IsHttpStatusRedirect ¶
func SplitRequestURI ¶
SplitRequestURI splits path and query string.
Types ¶
type Cache ¶
type Cache interface { Get(key CacheKey) interface{} Set(key CacheKey, value interface{}) Del(key CacheKey) Len() int // OnRelease sets a callback that will be called on the key is released. OnRelease(cb func(key CacheKey, value interface{})) }
Cache is an interface that defines accessor of the cache.
func NewExpireCache ¶
NewExpireCache returns a new cache with the specified expire (ms) and default interval 1 min.
func NewExpireCacheInterval ¶
NewExpireCacheInterval returns a new cache with the specified expire (ms) and interval (ms).
type CacheKey ¶ added in v0.3.4
type CacheKey uint64
func CacheKeyBytes ¶ added in v0.3.4
func CacheKeyString ¶ added in v0.3.4
type Strftime ¶ added in v0.0.2
type Strftime struct {
// contains filtered or unexported fields
}
Strftime is a strftime formatter.
func NewStrftime ¶ added in v0.0.2
NewStrftime creates a new Strftime.
func NewStrftimeBytes ¶ added in v0.0.2
NewStrftimeBytes creates a new Strftime.
func (*Strftime) AppendBytes ¶ added in v0.0.2
AppendBytes appends format result to dst and returns the extended buffer.
type StringList ¶ added in v0.3.6
type StringList []string
StringList is an array of strings that implements flag.Value.
func (*StringList) Set ¶ added in v0.3.6
func (ss *StringList) Set(value string) error
func (*StringList) String ¶ added in v0.3.6
func (ss *StringList) String() string