bots

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Empty

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

Empty is a bot that matches when the user agent is empty. An empty user agent is treated as a bot.

func NewEmpty

func NewEmpty(userAgent string) *Empty

func (*Empty) Match

func (e *Empty) Match() bool

Match returns true if the user agent is empty.

func (*Empty) Name

func (e *Empty) Name() string

Name returns genericBot.

type Keyword

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

Keyword is a bot that matches when the user agent contains a keyword.

func NewKeyword

func NewKeyword(userAgent string) *Keyword

NewKeyword returns a new Keyword bot.

func (*Keyword) Match

func (k *Keyword) Match() bool

Match returns true if the user agent contains a keyword.

func (*Keyword) Name

func (k *Keyword) Name() string

Name returns genericBot.

type Known

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

Known is a bot that matches when the user agent contains a keyword. It is used for bots that are known to be bots

func NewKnown

func NewKnown(userAgent string, bots map[string]string) *Known

NewKnown returns a new Known bot.

func (*Known) Match

func (k *Known) Match() bool

Match returns true if the user agent contains a keyword.

func (*Known) Name

func (k *Known) Name() string

Name returns the keyword that matched.

Jump to

Keyboard shortcuts

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