1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
| package main
type Config struct { Node string `json:"node,omitempty" yaml:"node"` Include []string `json:"include,omitempty" yaml:"include"` Cors *iCors `json:"cors,omitempty" yaml:"cors"` Routes []*iRoute `json:"routes,omitempty" yaml:"routes"` Clusters []*iCluster `json:"clusters,omitempty" yaml:"clusters"` TerminalDomain string `json:"terminal_domain" yaml:"terminal_domain"` }
type iCors struct { AllowMethods []string `json:"allow_methods,omitempty" yaml:"allow_methods"` AllowHeaders []string `json:"allow_headers,omitempty" yaml:"allow_headers"` ExposeHeaders []string `json:"expose_headers,omitempty" yaml:"expose_headers"` }
type iRoute struct { Match *iRouteMatch `json:"match,omitempty" yaml:"match"` Route *iRouteRoute `json:"route,omitempty" yaml:"route"` RequestHeadersToAdd []*iRouteHeader `json:"request_headers_to_add,omitempty" yaml:"request_headers_to_add"` }
type iRouteMatch struct { Prefix string `json:"prefix,omitempty" yaml:"prefix"` Header *iRouteMatchHeader `json:"header,omitempty" yaml:"header"` }
type iRouteMatchHeader struct { Name string `json:"name,omitempty" yaml:"name"` ExactMatch string `json:"exact_match,omitempty" yaml:"exact_match"` Re2Match string `json:"re2_match,omitempty" yaml:"re2_match"` }
type iRouteRoute struct { Cluster string `json:"cluster,omitempty" yaml:"cluster"` Timeout time.Duration `json:"timeout,omitempty" yaml:"timeout"` PrefixRewrite string `json:"prefix_rewrite,omitempty" yaml:"prefix_rewrite"` HostRewriteLiteral string `json:"host_rewrite_literal,omitempty" yaml:"host_rewrite_literal"` }
type iRouteHeader struct { Header *iKeyValue `json:"header,omitempty" yaml:"header"` }
type iKeyValue struct { Key string `json:"key,omitempty" yaml:"key"` Value string `json:"value,omitempty" yaml:"value"` }
type iCluster struct { Name string `json:"name,omitempty" yaml:"name"` Endpoint string `json:"endpoint,omitempty" yaml:"endpoint"` Http2 bool `json:"http2,omitempty" yaml:"http2"` Https bool `json:"https,omitempty" yaml:"https"`
Host string `json:"host,omitempty" yaml:"host"` Port uint32 `json:"port,omitempty" yaml:"port"` }
|