redirect

package
v0.0.0-...-437def5 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRedirectConfigFile = "redirect.yaml"
)

Variables

This section is empty.

Functions

func NewServer

func NewServer(listenAddr string, config Config) *redirectServer

func Router

func Router() *router

Router returns a router that can add or remove redirects

Types

type Config

type Config struct {
	Redirect []Redirect `yaml:"redirect,omitempty"`
}

func Load

func Load(configFile string) (Config, error)

type Redirect

type Redirect struct {
	config.HTTP
	config.TLSClient
	Address string `yaml:"address,omitempty"`
}

func (Redirect) RestartWatcher

func (r Redirect) RestartWatcher() (*fsnotify.Watcher, error)

func (Redirect) String

func (r Redirect) String() string

func (Redirect) ToHandler

func (r Redirect) ToHandler() http.Handler

Jump to

Keyboard shortcuts

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