feedtest

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package feedtest provides helpers for syndication feed tests involving HTTP requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateDummyFeed

func GenerateDummyFeed(t *testing.T, now time.Time) feeds.Feed

func HashETag

func HashETag(content string) string

Types

type RoundTripper

type RoundTripper struct {
	Requests []*http.Request
	// contains filtered or unexported fields
}

RoundTripper records incoming HTTP requests and responds with Atom feed data.

It supports HTTP conditional requests using the following HTTP headers: - ETag (response) / If-None-Match (request); - Last-Modified (response) / If-Modified-Since (request).

func NewRoundTripper

func NewRoundTripper(t *testing.T, feed feeds.Feed) *RoundTripper

NewRoundTripper initializes and returns a RoundTripper.

func (*RoundTripper) RoundTrip

func (rt *RoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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