Documentation ¶
Index ¶
- Variables
- func GetLogger(funcName string) *log.Logger
- func HashURL(url string) string
- func ProcessSites(hosts *Hosts, sources *Sources, state *State, numFetches uint) error
- type Fetch
- type Hosts
- func (h *Hosts) Add(newHosts []string)
- func (h *Hosts) Clear()
- func (h *Hosts) DumpToConsole()
- func (h *Hosts) DumpToFile(filename string) error
- func (h *Hosts) Hosts() []string
- func (h *Hosts) Len() uint
- func (h *Hosts) LoadCache(cacheID string) error
- func (h *Hosts) SaveCache(cacheID string) error
- type ResourceState
- type Sources
- type State
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Debug = false
)
View Source
var (
DefaultFetch = NewFetch()
)
Functions ¶
Types ¶
type Fetch ¶
type Fetch struct {
// contains filtered or unexported fields
}
func (*Fetch) ResourceState ¶
func (f *Fetch) ResourceState(url string) (ResourceState, error)
func (*Fetch) SetTimeout ¶
type Hosts ¶
type Hosts struct {
// contains filtered or unexported fields
}
func (*Hosts) DumpToConsole ¶
func (h *Hosts) DumpToConsole()
func (*Hosts) DumpToFile ¶
type ResourceState ¶
type ResourceState struct { LastModified time.Time `json:"last-modified,omitempty"` ETag string `json:"etag,omitempty"` }
func (ResourceState) IsETagStale ¶
func (rs ResourceState) IsETagStale(sourceETag string) bool
func (ResourceState) IsEmpty ¶
func (rs ResourceState) IsEmpty() bool
func (ResourceState) IsLastModifiedPast ¶
func (rs ResourceState) IsLastModifiedPast(sourceLastModified time.Time) bool
func (ResourceState) String ¶
func (rs ResourceState) String() string
type Sources ¶
type Sources struct {
// contains filtered or unexported fields
}
func NewSources ¶
func NewSources() *Sources
Click to show internal directories.
Click to hide internal directories.