Documentation ¶
Index ¶
- func DirExists(path string) bool
- func ExtractTextFromHTML(s string) string
- func FileExists(filename string) bool
- func FlatStruct(s interface{}) map[string]string
- func IsFlagPassed(name string) bool
- func MD5Sum(content interface{}) string
- func Md5File(filename string) (string, error)
- func ParseCookieFile(filename string) ([]*http.Cookie, error)
- func Sha1File(filename string) (string, error)
- func Sha256File(filename string) (string, error)
- func Sha512File(filename string) (string, error)
- type Cookies
- type GlobalTTLMap
- type HTMLMeta
- type TTLMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTextFromHTML ¶
ExtractTextFromHTML returns a string with only the text version of the web page
func FileExists ¶
FileExists returns true if the file is present on disk
func FlatStruct ¶ added in v0.9.1
FlatStruct tries to flat a struct object in a map[string]string
func IsFlagPassed ¶
IsFlagPassed returns true if the flag is present on the command line
func MD5Sum ¶ added in v0.8.2
func MD5Sum(content interface{}) string
MD5Sum calculate the MD5 Hash of a string or []byte
func ParseCookieFile ¶
ParseCookieFile transforms JSON file in slice of http.Cookie
func Sha256File ¶ added in v1.20.0
Sha256File calculate the SHA256 Hash of a file
func Sha512File ¶ added in v1.20.0
Sha512File calculate the SHA512 Hash of a file
Types ¶
type Cookies ¶
type Cookies []struct { Domain string `json:"domain"` ExpirationDate float64 `json:"expirationDate,omitempty"` HostOnly bool `json:"hostOnly"` HTTPOnly bool `json:"httpOnly"` Name string `json:"name"` Path string `json:"path"` SameSite string `json:"sameSite"` Secure bool `json:"secure"` Session bool `json:"session"` StoreID string `json:"storeId"` Value string `json:"value"` ID int `json:"id"` }
Cookies maps the json file exported from Chrome containing the cookies
type GlobalTTLMap ¶ added in v0.8.2
GlobalTTLMap is a cache shared between all the rules
func GetGlobalTTLMapInstance ¶ added in v0.8.2
func GetGlobalTTLMapInstance(gcdelay time.Duration) *GlobalTTLMap
GetGlobalTTLMapInstance returns the unique GlobalTTLMap (singleton)
type HTMLMeta ¶
type HTMLMeta struct { Title string `json:"title"` Description string `json:"description"` Image string `json:"image"` SiteName string `json:"site_name"` }
HTMLMeta contains information from the HTML page
func GetMetaFromHTML ¶
GetMetaFromHTML extracts info from an HTML page and store them on a HTMLMeta struct
type TTLMap ¶ added in v0.8.2
TTLMap is a cache with ttl
func GetNamedTTLMap ¶ added in v1.14.0
GetNamedTTLMap return a Cache stored on the globalTTLMap with a name
func (*TTLMap) SetPersistence ¶ added in v0.9.1
SetPersistence load the map from a file (it can be used only the first time)