2021-07-08 22:32:49 +02:00
|
|
|
package config
|
|
|
|
|
2021-07-10 23:57:45 +02:00
|
|
|
// ___ ____ ___ ___
|
|
|
|
// \ \ / / | _ | __| \ \ / / || | __ || || _ |
|
|
|
|
// \ \/ / |___ | |__ \ \/ / || |___ || ||___|
|
|
|
|
// \ / | _ | _ | \ / || __ | || ||\\
|
|
|
|
// \/ |___ |___ | \/ || ____| || || \\
|
|
|
|
|
|
|
|
// Copyright (c) 2021 Piotr Biernat. https://pbiernat.dev. MIT License
|
|
|
|
// Repo: https://git.pbiernat.dev/golang/vegvisir
|
|
|
|
|
2021-07-08 22:32:49 +02:00
|
|
|
type Config struct {
|
|
|
|
Server Server
|
2021-07-10 23:57:45 +02:00
|
|
|
Backends map[string]Backend
|
2021-07-08 22:32:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type Server struct {
|
|
|
|
Address string
|
|
|
|
Port int
|
|
|
|
}
|
|
|
|
|
2021-07-10 23:57:45 +02:00
|
|
|
type Backend struct {
|
|
|
|
PrefixUrl string
|
|
|
|
BackendAddress string
|
|
|
|
Protocol string
|
|
|
|
Routes []Route
|
|
|
|
}
|
|
|
|
|
|
|
|
type Route struct {
|
|
|
|
Pattern string
|
|
|
|
Target string
|
|
|
|
}
|
|
|
|
|
|
|
|
var DefaultRoute = Route{
|
|
|
|
Pattern: "(.*)",
|
|
|
|
Target: "",
|
2021-07-08 22:32:49 +02:00
|
|
|
}
|