redirectprovider

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 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 DimensionProviderFunc

type DimensionProviderFunc func(r *http.Request) (store.Dimension, error)

type IsAutomaticRedirectInitiallyStaleProviderFunc added in v1.1.0

type IsAutomaticRedirectInitiallyStaleProviderFunc func() bool

type MatcherFunc

type MatcherFunc func(r *http.Request) (*store.RedirectDefinition, error)

type RedirectsProvider

type RedirectsProvider struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewProvider

func NewProvider(
	l *zap.Logger,
	providerFunc RedirectsProviderFunc,
	dimensionProviderFunc DimensionProviderFunc,
	updateChannel chan *nats.Msg,
	matcherFuncs ...MatcherFunc,
) *RedirectsProvider

func (*RedirectsProvider) Close

func (p *RedirectsProvider) Close(_ context.Context) error

func (*RedirectsProvider) Process

func (p *RedirectsProvider) Process(r *http.Request) (redirect *store.Redirect, err error)

func (*RedirectsProvider) Start

func (p *RedirectsProvider) Start(ctx context.Context) error

type RedirectsProviderInterface

type RedirectsProviderInterface interface {
	Start(ctx context.Context) error
	Close(ctx context.Context) error
	Process(r *http.Request) (*store.Redirect, error)
}

type RestrictedSourcesProviderFunc added in v1.1.0

type RestrictedSourcesProviderFunc func() []string

type SiteIdentifierProviderFunc

type SiteIdentifierProviderFunc func(r *http.Request) (store.Site, error)

type UserProviderFunc added in v1.1.0

type UserProviderFunc func(ctx context.Context) string

Jump to

Keyboard shortcuts

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