crawlerdetect

package
v0.0.0-...-53f744f Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Baidu  = "baidu"
	Bing   = "bing"
	Google = "google"
	Sogou  = "sogou"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaiduStrategy

type BaiduStrategy struct {
	*UniversalStrategy
}

func NewBaiduStrategy

func NewBaiduStrategy() *BaiduStrategy

type BingStrategy

type BingStrategy struct {
	*UniversalStrategy
}

func NewBingStrategy

func NewBingStrategy() *BingStrategy

type GoogleStrategy

type GoogleStrategy struct {
	*UniversalStrategy
}

func NewGoogleStrategy

func NewGoogleStrategy() *GoogleStrategy

type SoGouStrategy

type SoGouStrategy struct {
	Hosts []string
}

func NewSoGouStrategy

func NewSoGouStrategy() *SoGouStrategy

func (*SoGouStrategy) CheckCrawler

func (s *SoGouStrategy) CheckCrawler(ip string) (bool, error)

type Strategy

type Strategy interface {
	CheckCrawler(ip string) (bool, error)
}

func NewCrawlerDetector

func NewCrawlerDetector(crawler string) Strategy

type UniversalStrategy

type UniversalStrategy struct {
	Hosts []string
}

func NewUniversalStrategy

func NewUniversalStrategy(hosts []string) *UniversalStrategy

func (*UniversalStrategy) CheckCrawler

func (s *UniversalStrategy) CheckCrawler(ip string) (bool, error)

Jump to

Keyboard shortcuts

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