proxy

package
v0.0.0-...-ec3c1f2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2016 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

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

Content - proxy struct for database.Content

func NewContent

func NewContent(body []byte, title string) *Content

NewContent - create Content

func (*Content) GetContent

func (in *Content) GetContent(urlID int64) *database.Content

GetContent - convert to content.Content

type DbHost

type DbHost interface {
	// GetHosts - return map[id]Host
	GetHosts() (map[int64]*Host, error)
	// AddHost - baseURL: init url for host
	AddHost(host *Host, baseURL string) (int64, error)
}

DbHost - database interface for work with host

type Host

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

Host - proxy struct for database.Host

func NewHost

func NewHost(name string, robotsStatusCode int, robotsData []byte) *Host

NewHost - create Host

func (*Host) GetName

func (h *Host) GetName() string

GetName - get name

func (*Host) GetRobotsTxt

func (h *Host) GetRobotsTxt() (int, []byte)

GetRobotsTxt - get data for init robots.txt

func (*Host) GetTable

func (h *Host) GetTable() *database.Host

GetTable - get field host converted for Db

type Meta

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

Meta - proxy struct for database.Meta

func NewMeta

func NewMeta(hostID sql.NullInt64, urlStr string, referer *Meta) *Meta

NewMeta - create Meta

func (*Meta) GetContent

func (in *Meta) GetContent() *Content

GetContent - get field content

func (*Meta) GetHash

func (in *Meta) GetHash() string

GetHash - get content hash

func (*Meta) GetHostID

func (in *Meta) GetHostID() sql.NullInt64

GetHostID - get field hostID

func (*Meta) GetMeta

func (in *Meta) GetMeta(urlID int64) *database.Meta

GetMeta - get field meta converted for Db

func (*Meta) GetReferer

func (in *Meta) GetReferer() *Meta

GetReferer - get field redirectReferer

func (*Meta) GetState

func (in *Meta) GetState() database.State

GetState - get field state

func (*Meta) GetURL

func (in *Meta) GetURL() string

GetURL - get current URL

func (*Meta) NeedWaitAfterRequest

func (in *Meta) NeedWaitAfterRequest() bool

NeedWaitAfterRequest - Check is need wait after request by state

func (*Meta) SetContent

func (in *Meta) SetContent(content *Content)

SetContent - set new content

func (*Meta) SetOrigin

func (in *Meta) SetOrigin(origin sql.NullInt64)

SetOrigin - set new content

func (*Meta) SetState

func (in *Meta) SetState(state database.State)

SetState - set new state

func (*Meta) SetStatusCode

func (in *Meta) SetStatusCode(statusCode int)

SetStatusCode - set new status code

type PageData

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

PageData - full info from page

func NewPageData

func NewPageData(meta *Meta, urls map[string]sql.NullInt64) *PageData

NewPageData - create PageData

func (*PageData) GetMeta

func (in *PageData) GetMeta() *Meta

GetMeta - get field meta

func (*PageData) GetParentURL

func (in *PageData) GetParentURL() int64

GetParentURL - get field parentURL

func (*PageData) GetURLs

func (in *PageData) GetURLs() map[string]sql.NullInt64

GetURLs - get field urls

func (*PageData) SetParentURL

func (in *PageData) SetParentURL(parentURL int64)

SetParentURL - set field parentURL

Jump to

Keyboard shortcuts

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