helpers

package
v0.0.0-...-098fe98 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcTime

func CalcTime(start time.Time, end time.Time) int64

CalcTime ...

func CalcTimeNow

func CalcTimeNow(end time.Time) int64

CalcTimeNow ...

func CookiesToString

func CookiesToString(cookie []*http.Cookie) (res string)

CookiesToString ...

func GetCookiesNames

func GetCookiesNames(cookie []*http.Cookie) (res []string)

GetCookiesNames ...

func GetHeadersNames

func GetHeadersNames(header http.Header) (res []string)

GetHeadersNames Gets the header name

func HeadersToString

func HeadersToString(header http.Header) (res string)

HeadersToString ...

func IsDigit

func IsDigit(X byte) bool

IsDigit Determines given byte is digit

func IsMatch

func IsMatch(pattern string, str string) (bool, error)

IsMatch checks for matching string

func IsODidit

func IsODidit(X byte) bool

IsODidit checks if the byte is a octo decimal digit

func IsSpace

func IsSpace(X byte) bool

IsSpace checks for white-space characters. In the "C" and "POSIX" locales, these are: space, form-feed ('\f'), newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab ('\v').

func PreProcessString

func PreProcessString(value string) string

PreProcessString ...

func StringContains

func StringContains(slice []string, item string) bool

StringContains searches given string in a string slice

func UnEscapeRawValue

func UnEscapeRawValue(rawQuery string) string

UnEscapeRawValue unescapes raw query

func ValidHex

func ValidHex(X byte) bool

ValidHex ...

func X2c

func X2c(c1 byte, c2 byte) byte

X2c Combines two hex chars into a single byte

func XSingle2c

func XSingle2c(c byte) byte

XSingle2c Converts a hex char into a byte

Types

type Matcher

type Matcher struct {
	// contains filtered or unexported fields
}

Matcher is returned by NewMatcher and contains a list of blices to match against

func NewMatcher

func NewMatcher(dictionary [][]byte) *Matcher

NewMatcher creates a new Matcher used to match against a set of blices

func NewStringMatcher

func NewStringMatcher(dictionary []string) *Matcher

NewStringMatcher creates a new Matcher used to match against a set of strings (this is a helper to make initialization easy)

func (*Matcher) Match

func (m *Matcher) Match(in []byte) []int

Match searches in for blices and returns all the blices found as indexes into the original dictionary

Jump to

Keyboard shortcuts

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