redirectprovider

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MatcherFunc

type MatcherFunc func(request store.RedirectRequest) (*store.RedirectDefinition, error)

type ProductURLProvider

type ProductURLProvider func(ctx context.Context, legacyID string) (productURL string, clientErr error)

type RedirectsProvider

type RedirectsProvider struct {
	MatcherFuncs []MatcherFunc
	// contains filtered or unexported fields
}

func NewRedirectsProvider

func NewRedirectsProvider(
	l *zap.Logger,
	ctx context.Context,
	regexLegacyProductURL *regexp.Regexp,
	persistor keelmongo.Persistor,
	useNats bool,
	matcherFuncs ...MatcherFunc) (*RedirectsProvider, error)

func (*RedirectsProvider) LoadRedirects

func (p *RedirectsProvider) LoadRedirects() error

func (*RedirectsProvider) Process

func (p *RedirectsProvider) Process(originalRequest store.RedirectRequest) (*store.Redirect, error)

Jump to

Keyboard shortcuts

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