utils

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAbility

func CheckAbility(visited map[string]struct{}, rules Rules, normURL string) bool

func CheckDomain

func CheckDomain(domain *url.URL, rawURL string) (bool, error)

func GetHTML

func GetHTML(rawURL string) ([]byte, error)

func GetRobots

func GetRobots(rawURL string) ([]byte, error)

func Normalize

func Normalize(rawURL string) (string, error)

Types

type Queue

type Queue []string

queue implementation

func (*Queue) CheckEmpty

func (q *Queue) CheckEmpty() bool

func (*Queue) Dequeue

func (q *Queue) Dequeue() (string, error)

func (*Queue) Enqueue

func (q *Queue) Enqueue(url string)

func (*Queue) Peek

func (q *Queue) Peek() (string, error)

func (*Queue) Size

func (q *Queue) Size() int

type QueueOps

type QueueOps interface {
	Enqueue(string)
	Dequeue() (string, error)
	Peek() (string, error)
	Empty() bool
	Size() int
}

type Response

type Response struct {
	Title   string
	Content []string
	Links   []string
}

func ParseHTML

func ParseHTML(domain *url.URL, page []byte) (Response, error)

type Rules

type Rules struct {
	Allowed    []string
	Disallowed []string
	Delay      int
}

func ParseRobots

func ParseRobots(normURL string, textFile []byte) (Rules, error)

Jump to

Keyboard shortcuts

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