fetch

package
v0.0.0-...-edf5a02 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package fetch provides an API for fetching information about urls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FeedHeader

func FeedHeader(fetcher Fetcher, fetchURL, contentType string, body io.Reader) (microsub.Feed, error)

FeedHeader returns a new microsub.Feed with the information parsed from body.

func FeedItems

func FeedItems(fetcher Fetcher, fetchURL, contentType string, body io.Reader) ([]microsub.Item, error)

FeedItems returns the items from the url, parsed from body.

Types

type Fetcher

type Fetcher interface {
	Fetch(url string) (*http.Response, error)
}

Fetcher fetches urls

type FetcherFunc

type FetcherFunc func(url string) (*http.Response, error)

FetcherFunc is a function that fetches an url

func (FetcherFunc) Fetch

func (ff FetcherFunc) Fetch(url string) (*http.Response, error)

Fetch fetches an url and returns a response or error

Jump to

Keyboard shortcuts

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