inspect

package
v0.0.0-...-a9b0586 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package inspect Feed Discovery Methods - Inside link, and a tags with rel="alternate" attribute - Inside script tag with structured json data - HTTP Header ( Link Header ) - Brute forcing common feed paths

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerFunc

type HandlerFunc func(string)

type Inspector

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

func NewInspector

func NewInspector(options ...Option) (*Inspector, error)

func (*Inspector) Find

func (i *Inspector) Find() error

type InspectorConfig

type InspectorConfig struct {
	// strategies option is ignored in case PipedInput is defined
	PipedInput *bufio.Reader

	TargetURL  *string
	Strategies struct {
		// HTTP Link Header with feed attributes
		Header bool
		// a and link tags with feed attributes
		Page bool
		// try and fetch common feed urls, if they contain valid feeds they will be reported
		Common bool
	}
	// fetch and Validate reported feed links, common strategy validates the feed content regardless of this option
	Validate bool
	// found feeds will be reported to this function
	OutputHandler HandlerFunc
}

type Option

type Option func(*InspectorConfig)

func WithOutputHandler

func WithOutputHandler(outputHandler HandlerFunc) Option

func WithPipedInput

func WithPipedInput(htmlBody *bufio.Reader) Option

func WithStrategyCommon

func WithStrategyCommon() Option

func WithStrategyHeader

func WithStrategyHeader() Option

func WithStrategyPage

func WithStrategyPage() Option

func WithTargetURL

func WithTargetURL(targetURL string) Option

func WithValidate

func WithValidate() Option

Jump to

Keyboard shortcuts

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