chain

package
v0.0.0-...-93e9239 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoUnwrapperFound = errors.New("no unwrapper found")
)

Functions

This section is empty.

Types

type ChainEntry

type ChainEntry struct {
	From  url.URL
	To    url.URL
	Using unwrap.Unwrapper
}

ChainEntry describes the transition from moving to one URL to the next, given the unwrapper that was used

type ChainedUnwrapper

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

func New

func New(r *http.Request, unwrappers map[string]*unwrap.Unwrapper) (*ChainedUnwrapper, error)

func (*ChainedUnwrapper) Err

func (c *ChainedUnwrapper) Err() error

Err returns the last error set

func (*ChainedUnwrapper) Last

func (c *ChainedUnwrapper) Last() *url.URL

Err returns the currently set URL

func (*ChainedUnwrapper) Next

func (c *ChainedUnwrapper) Next() bool

Next will visit the next endpoint in the chain. Returns false when the end of the chain is reached or if there is an error

func (*ChainedUnwrapper) Visited

func (c *ChainedUnwrapper) Visited() []ChainEntry

Err returns a slice of ChainEntry structs that describe the hops visited before finding the final URL

Jump to

Keyboard shortcuts

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