gorm_storage

package
v0.0.0-...-3a8e372 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	VisitedTable string
	CookiesTable string
	// contains filtered or unexported fields
}

Storage implements a PostgreSQL storage backend for colly

func NewStorage

func NewStorage(visitedTable string, cookiesTable string, db *gorm.DB) *Storage

func (*Storage) Clear

func (s *Storage) Clear() error

Clear clears storage

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 PostgreSQL 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.Visited()

Jump to

Keyboard shortcuts

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