feat(proxy): Add reverse proxy feature
This commit is contained in:
@@ -1,11 +1,73 @@
|
||||
package config
|
||||
|
||||
type Config interface {
|
||||
type BaseConfiguration interface {
|
||||
GetConfiguration() *Configuration
|
||||
GetGatewayConfiguration() *GatewayConfiguration
|
||||
GetFeatures() []string
|
||||
GetRoutes() []RouteConfiguration
|
||||
GetApis() []ApiConfiguration
|
||||
GetHost() string
|
||||
GetPort() int
|
||||
}
|
||||
|
||||
type Configuration struct {
|
||||
Gateway Gateway `yaml:"gateway"`
|
||||
Hosts []Host `yaml:"hosts"`
|
||||
Targets []Target `yaml:"targets"`
|
||||
Apis []Api `yaml:"apis"`
|
||||
Routes []Route `yaml:"routes"`
|
||||
}
|
||||
|
||||
type Gateway struct {
|
||||
Host string `yaml:"host"`
|
||||
Port int `yaml:"port"`
|
||||
Features []string `yaml:"features"`
|
||||
}
|
||||
|
||||
type Host struct {
|
||||
ID string `yaml:"id"`
|
||||
Name string `yaml:"name"`
|
||||
Domain string `yaml:"domain"`
|
||||
Secure bool `yaml:"secure"`
|
||||
}
|
||||
|
||||
type Target struct {
|
||||
ID string `yaml:"id"`
|
||||
Name string `yaml:"name"`
|
||||
URL string `yaml:"url"`
|
||||
}
|
||||
|
||||
type Api struct {
|
||||
ID string `yaml:"id"`
|
||||
Host string `yaml:"host"`
|
||||
Target string `yaml:"target"`
|
||||
}
|
||||
|
||||
type Route struct {
|
||||
ID string `yaml:"id"`
|
||||
Api string `yaml:"api"`
|
||||
Path string `yaml:"path"`
|
||||
StripPrefix StripPrefix `yaml:"strip_prefix"`
|
||||
Security Security `yaml:"security"`
|
||||
}
|
||||
|
||||
type StripPrefix struct {
|
||||
Enabled bool `yaml:"enabled"`
|
||||
Prefix string `yaml:"prefix"`
|
||||
}
|
||||
|
||||
type Security struct {
|
||||
Auth Auth `yaml:"auth"`
|
||||
WAF WAF `yaml:"waf"`
|
||||
}
|
||||
|
||||
type Auth struct {
|
||||
Enabled bool `yaml:"enabled"`
|
||||
Type string `yaml:"type"`
|
||||
Header string `yaml:"header"`
|
||||
Path AuthPath `yaml:"path"`
|
||||
}
|
||||
|
||||
type AuthPath struct {
|
||||
Include []string `yaml:"include"`
|
||||
Exclude []string `yaml:"exclude"`
|
||||
}
|
||||
|
||||
type WAF struct {
|
||||
Enabled bool `yaml:"enabled"`
|
||||
Methods []string `yaml:"methods"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user