httpfetch

package
v0.0.0-...-0be70c8 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package httpfetch makes a remote HTTP call to retrieve an URL, and parse that into a series of feed-items

It is abstracted into its own class to allow testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPFetch

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

HTTPFetch is our state-storing structure

func New

func New(entry configfile.Feed, log *slog.Logger) *HTTPFetch

New creates a new object which will fetch our content.

func (*HTTPFetch) Fetch

func (h *HTTPFetch) Fetch() (*gofeed.Feed, error)

Fetch performs the HTTP-fetch, and returns the feed-contents.

If our internal `content` field is non-empty it will be used in preference to making a remote request, which is useful for testing.

Jump to

Keyboard shortcuts

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