1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-08 12:00:36 +08:00

Move raw ingress rules to config package

This commit is contained in:
Igor Postelnik
2020-10-20 12:00:34 -05:00
parent ca4887fb19
commit ed54d150fe
5 changed files with 27 additions and 28 deletions

View File

@@ -12,7 +12,6 @@ import (
"github.com/urfave/cli/v2"
"gopkg.in/yaml.v2"
"github.com/cloudflare/cloudflared/ingress"
"github.com/cloudflare/cloudflared/logger"
"github.com/cloudflare/cloudflared/validation"
)
@@ -197,15 +196,21 @@ func ValidateUrl(c *cli.Context, allowFromArgs bool) (string, error) {
return validUrl, err
}
type UnvalidatedIngressRule struct {
Hostname string
Path string
Service string
}
type Configuration struct {
TunnelID string `yaml:"tunnel"`
Ingress ingress.UnvalidatedIngress `yaml:",inline"`
TunnelID string `yaml:"tunnel"`
Ingress []UnvalidatedIngressRule
sourceFile string
}
type configFileSettings struct {
Configuration `yaml:",inline"`
// Existing settings will be aggregated in the generic map, should be read via cli.Context
// older settings will be aggregated into the generic map, should be read via cli.Context
Settings map[string]interface{} `yaml:",inline"`
}