mongo

package
v0.0.0-...-68eaa9b Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CookiesDocument

type CookiesDocument struct {
	Host    string `json:"host"`
	Cookies string `json:"cookies"`
}

type Storage

type Storage struct {
	Database string
	URI      string
	// contains filtered or unexported fields
}

Storage implements a MongoDB storage backend for colly

func (*Storage) Cookies

func (s *Storage) Cookies(u *url.URL) string

Cookies implements colly/storage.Cookies()

func (*Storage) Init

func (s *Storage) Init() error

Init initializes the MongoDB storage

func (*Storage) IsVisited

func (s *Storage) IsVisited(requestID uint64) (bool, error)

IsVisited implements colly/storage.IsVisited()

func (*Storage) SetCookies

func (s *Storage) SetCookies(u *url.URL, cookies string)

SetCookies implements colly/storage.SetCookies()

func (*Storage) Visited

func (s *Storage) Visited(requestID uint64) error

Visited implements colly/storage.VisitedDocument()

type VisitedDocument

type VisitedDocument struct {
	RequestID string `json:"requestID"`
	Visited   bool   `json:"visited"`
}

VisitedDocument represents the document we want to insert into MongoDB when we have visited a page.

Jump to

Keyboard shortcuts

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