Documentation ¶
Index ¶
- func BuildNoGZipTableData(files []GZipFile) [][]string
- func DistanceColor(c1 color.Color, c2 color.Color) float64
- func DistanceImg(fn1 string, fn2 string, mfn string) (image.Image, float64, error)
- func FormatByteSize(bytesize int) string
- func FormatTime(time int) string
- func GetHostname(str string) (string, error)
- func GetImageRectName(w int, h int) string
- func GetLightness(fn string) (image.Image, float64, error)
- func GetResType(res *jarviscrawlercore.AnalyzeReqInfo) (string, error)
- func GetResWithScheme(reqs []*jarviscrawlercore.AnalyzeReqInfo, scheme string) ([]string, error)
- func GetSaturation(fn string) (image.Image, float64, error)
- func GetScheme(str string) (string, error)
- func GetURLName(url string) string
- func InitLogger(cfg *Config)
- func ToWebp(fn string, Lossless bool, quality float32) ([]byte, error)
- type Config
- type GZipFile
- type HostnameInfo
- type HostnameList
- type IPGeoInfo
- type Image
- type ImageMgr
- type ImgTypeInfo
- type ResSourceData
- type ResTreeMapData
- type ResTypeData
- type ResTypeInfo
- type ResTypeMgr
- type SourceInfo
- type SourceList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildNoGZipTableData ¶
BuildNoGZipTableData - build [][]string
func DistanceColor ¶
DistanceColor - count distance c1 and c2
func DistanceImg ¶
DistanceImg - distance image img1 and img2
func GetHostname ¶
GetHostname - https://www.a.com/b/c.png => www.a.com
func GetImageRectName ¶
GetImageRectName - (100, 50) => 100x50, (50, 100) => 100x50
func GetLightness ¶
GetLightness - get lightness and variance
func GetResType ¶
func GetResType(res *jarviscrawlercore.AnalyzeReqInfo) (string, error)
GetResType - https://www.a.com/b/c.png => https
func GetResWithScheme ¶
func GetResWithScheme(reqs []*jarviscrawlercore.AnalyzeReqInfo, scheme string) ( []string, error)
GetResWithScheme - get resource with scheme
func GetSaturation ¶
GetSaturation - get saturation and variance
func GetScheme ¶
GetScheme - https://www.a.com/b/c.png => https
Types ¶
type Config ¶
type Config struct { // AdaCoreServAddr - Ada core service address AdaCoreServAddr string // AdaCoreToken - This is a valid adacoreserv token AdaCoreToken string // JarvisCrawlerServAddr - Jarvis Crawler service address JarvisCrawlerServAddr string // JarvisCrawlerToken - This is a valid jarviscrawler token JarvisCrawlerToken string // ClientTokens - There are the valid clienttokens for this node ClientTokens []string Log struct { // LogPath - log path LogPath string // LogLevel - log level, it can be debug, info, warn, error LogLevel string // LogConsole - it can be output to console LogConsole bool } }
Config - config
type GZipFile ¶
GZipFile - gzip file infomation
func GetNoGZip ¶
func GetNoGZip(reqs []*jarviscrawlercore.AnalyzeReqInfo) ( []GZipFile, error)
GetNoGZip - get no gzip resource
type HostnameInfo ¶
HostnameInfo - hostname infomation
type HostnameList ¶
type HostnameList struct {
List []*HostnameInfo
}
HostnameList - hostname infomation list
func AnalyzeHostNameInfo ¶
func AnalyzeHostNameInfo(ctx context.Context, ipgeodb *ipgeo.DB, reqs []*jarviscrawlercore.AnalyzeReqInfo) (*HostnameList, error)
AnalyzeHostNameInfo - analyze hostname
func (*HostnameList) Find ¶
func (sl *HostnameList) Find(hostname string) *HostnameInfo
Find - find a SourceInfo
type ImageMgr ¶
type ImageMgr struct { Imgs []*Image TreeMap []adacore.ChartTreeMapSeriesNodeFloat HostList []string }
ImageMgr - image manager
func AnalyzeImageMgr ¶
func AnalyzeImageMgr(reqs []*jarviscrawlercore.AnalyzeReqInfo) (*ImageMgr, error)
AnalyzeImageMgr - analyze image manager
type ImgTypeInfo ¶
ImgTypeInfo - image type infomation
type ResSourceData ¶
type ResSourceData struct { ResSource []string `yaml:"source"` Bytes []int `yaml:"bytes"` MBytes []float32 `yaml:"mbytes"` Time []int `yaml:"time"` Nums []int `yaml:"nums"` DownloadSpeed []float32 `yaml:"downloadspeed"` }
ResSourceData - resource source data
type ResTreeMapData ¶
type ResTreeMapData struct { TreeMap []adacore.ChartTreeMapSeriesNode HostList []string // contains filtered or unexported fields }
ResTreeMapData - resource treemap data
func AnalyzeResTreeMap ¶
func AnalyzeResTreeMap(reqs []*jarviscrawlercore.AnalyzeReqInfo) (*ResTreeMapData, error)
AnalyzeResTreeMap - analyze request
type ResTypeData ¶
type ResTypeData struct { ResType []string `yaml:"restype"` Bytes []int `yaml:"bytes"` MBytes []float32 `yaml:"mbytes"` Time []int `yaml:"time"` Nums []int `yaml:"nums"` DownloadSpeed []float32 `yaml:"downloadspeed"` ImgType []string `yaml:"imgtype"` ImgBytes []int `yaml:"imgbytes"` ImgTime []int `yaml:"imgtime"` ImgNums []int `yaml:"imgnums"` }
ResTypeData - resource type data
type ResTypeInfo ¶
ResTypeInfo - resource type infomation
type ResTypeMgr ¶
type ResTypeMgr struct { List []*ResTypeInfo ImgList []*ImgTypeInfo }
ResTypeMgr - resource type infomation list
func AnalyzeResType ¶
func AnalyzeResType(reqs []*jarviscrawlercore.AnalyzeReqInfo) (*ResTypeMgr, error)
AnalyzeResType - analyze request
func (*ResTypeMgr) Find ¶
func (mgr *ResTypeMgr) Find(restype string) *ResTypeInfo
Find - find a SourceInfo
func (*ResTypeMgr) FindImage ¶
func (mgr *ResTypeMgr) FindImage(w int, h int) *ImgTypeInfo
FindImage - find a image
func (*ResTypeMgr) Insert ¶
func (mgr *ResTypeMgr) Insert(restype string, bytes int, time int)
Insert - insert a SourceInfo
func (*ResTypeMgr) InsertImage ¶
func (mgr *ResTypeMgr) InsertImage(w int, h int, bytes int, time int)
InsertImage - insert a image
func (*ResTypeMgr) ToData ¶
func (mgr *ResTypeMgr) ToData() *ResTypeData
ToData - SourceList => ResSourceData
type SourceInfo ¶
SourceInfo - source infomation
type SourceList ¶
type SourceList struct {
List []*SourceInfo
}
SourceList - source infomation list
func AnalyzeResSource ¶
func AnalyzeResSource(reqs []*jarviscrawlercore.AnalyzeReqInfo) (*SourceList, error)
AnalyzeResSource - analyze request
func (*SourceList) Find ¶
func (sl *SourceList) Find(host string) *SourceInfo
Find - find a SourceInfo
func (*SourceList) Insert ¶
func (sl *SourceList) Insert(host string, bytes int, time int)
Insert - insert a SourceInfo
func (*SourceList) ToData ¶
func (sl *SourceList) ToData() *ResSourceData
ToData - SourceList => ResSourceData