Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func URLRedirectMW ¶
func URLRedirectMW(next http.Handler, yamlFilePath string) http.HandlerFunc
URLRedirectMW middleware function which acts on request and redirects URL to another URL when it sees path matching another URL defined in yaml file
func YamlMapBuilder ¶
YamlMapBuilder builds a map from data present in yaml file as Path and related URL to be redirected to. The map created is used to fetch URL based on path
Types ¶
type Config ¶
type Config struct {
Map []Mapper `yaml:"mapper"`
}
func YamlHandler ¶
YamlHandler parses yaml file and unmarshalls yaml bytes into struct defined
Click to show internal directories.
Click to hide internal directories.