feed

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrContextFormat = errors.New("context format is invalid")

Functions

func DetectFormat

func DetectFormat(next http.Handler) http.Handler

func FormatStrings

func FormatStrings() []string

FormatStrings returns a slice of all String values of the enum

func NewFormatContext

func NewFormatContext(ctx context.Context, t Format) context.Context

func WriteFeed

func WriteFeed(w http.ResponseWriter, r *http.Request, f *feeds.Feed) error

func WritePodcast

func WritePodcast(w http.ResponseWriter, r *http.Request, f *podcast.Podcast) error

Types

type Format

type Format uint8
const (
	FormatUnknown Format = iota
	FormatAtom
	FormatRSS
	FormatJSON
)

func FormatFromContext

func FormatFromContext(ctx context.Context) (Format, bool)

func FormatString

func FormatString(s string) (Format, error)

FormatString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func FormatValues

func FormatValues() []Format

FormatValues returns all values of the enum

func (Format) IsAFormat

func (i Format) IsAFormat() bool

IsAFormat returns "true" if the value is listed in the enum definition. "false" otherwise

func (Format) String

func (i Format) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳