filerules

package
v0.0.0-...-58ab302 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Rules []Rule `json:"rules"`
}

Config describes file configuration

type PatternRule

type PatternRule struct {
	Pattern *regexp.Regexp
	Rule
}

PatternRule hods config rule + compiled pattern

type Provider

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

Provider applies rules to requested URI

func New

func New(configFile string) (*Provider, error)

New returns new proxy rules provider from file

func (*Provider) Transform

func (p *Provider) Transform(source string) (string, error)

Transform calculates destination URL based on input and proxy rules

type Rule

type Rule struct {
	Pattern string `json:"pattern"`
	URL     string `json:"url"`
}

Rule contains rule information (from config file)

Jump to

Keyboard shortcuts

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