baidu

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Strategy

type Strategy struct {
	*crawlerdetect.UniversalStrategy
}

Strategy is a struct used for detecting web crawlers. It embeds a pointer to an instance of the UniversalStrategy from the crawlerdetect package. By embedding it, the Strategy struct can directly call the methods and use the properties of the `UniversalStrategy`, achieving behavior akin to inheritance.

func InitStrategy

func InitStrategy() *Strategy

InitStrategy is a function that creates and initializes an instance of the Strategy struct. It sets up the embedded UniversalStrategy with a pre-defined list of known crawler hostnames of Baidu, a popular search engine in China and Japan.

Returns: - *Strategy: A pointer to an instance of the Strategy struct. Thanks to the predefined list of hosts in the `UniversalStrategy`, this `Strategy` instance is ready to detect crawlers from Baidu.

Jump to

Keyboard shortcuts

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