fetchers

package
v0.0.0-...-04251c3 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2014 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KatScout

func KatScout(done chan uint16) (err error)

Types

type KatFetch

type KatFetch struct {
	StartTime time.Time
	Elapsed   time.Duration

	Data []*KatRow
	// contains filtered or unexported fields
}

*

  • Fetcher v2 Declaration *
  • Every KatFetch contains 25 torrent rows (max)
  • For each category, the max amout of KatFetch(ers) is 400

func NewKatFetch

func NewKatFetch() *KatFetch

func (*KatFetch) Done

func (k *KatFetch) Done(data []*KatRow, httpClient *http.Client, httpChannel chan *http.Client, collection *KatFetchCollection)

func (*KatFetch) Fail

func (k *KatFetch) Fail(err error, httpClient *http.Client, httpChannel chan *http.Client, collection *KatFetchCollection, page int)

one of the possible endings for the fetch operation

func (*KatFetch) Fetch

func (k *KatFetch) Fetch(httpClient *http.Client, httpChannel chan *http.Client, collection *KatFetchCollection)

type KatFetchCollection

type KatFetchCollection struct {
	ActiveFetchers int `json:"-"`
	Current        int `json:"-"`

	Data     []*KatFetch `json:"successFetch"`
	Failures []*KatFetch `json:"failedFetch"`

	Completed chan *KatFetch `json:"-"`

	Board []bool `json:"-"`
}

*

  • A KatFetch Collection contains ~howmany KatFetch(es)

func NewKatFetchCollection

func NewKatFetchCollection(howmany int) *KatFetchCollection

func (*KatFetchCollection) Done

func (k *KatFetchCollection) Done()

func (*KatFetchCollection) ExportFailure

func (k *KatFetchCollection) ExportFailure() ([]byte, error)

func (*KatFetchCollection) ExportSuccess

func (k *KatFetchCollection) ExportSuccess() ([]byte, error)

func (*KatFetchCollection) Failure

func (k *KatFetchCollection) Failure(fetch *KatFetch)

func (*KatFetchCollection) GetPage

func (k *KatFetchCollection) GetPage() (int, error)

func (*KatFetchCollection) ReceiveData

func (k *KatFetchCollection) ReceiveData()

ReceiveData is a function that should be called as goroutine, waiting for data to be sent

func (*KatFetchCollection) ReturnPage

func (k *KatFetchCollection) ReturnPage(page int)

func (*KatFetchCollection) Success

func (k *KatFetchCollection) Success(fetch *KatFetch) error

type KatRow

type KatRow struct {
	Name   string
	Magnet string
	Size   uint64
	Files  uint64
	Age    *time.Time
}

func NewKatPage

func NewKatPage(page *http.Response) ([]*KatRow, error)

Jump to

Keyboard shortcuts

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