Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition struct { Type ConditionType Value map[string]string }
Condition is the condition that the traffic can reach the specified backend
type ConditionType ¶
type ConditionType string
ConditionType condition type
var CookieType ConditionType = "cookie"
CookieType -
var DefaultType ConditionType = "default"
DefaultType -
var HeaderType ConditionType = "header"
HeaderType -
type Config ¶
type Config struct { HTTPPools []*Pool TCPPools []*Pool L7VS []*VirtualService L4VS []*VirtualService }
Config contains all the configuration of the gateway
type HTTPRule ¶
type HTTPRule struct { Meta Domain string `json:"domain"` Path string `json:"path"` Headers map[string]string `json:"headers"` Redirect RedirectConfig `json:"redirect,omitempty"` HTTPSEnabale bool `json:"https_enable"` SSLCertName string `json:"ssl_cert_name"` PoolName string `json:"pool_name"` }
HTTPRule Application service access rule for http
type LoadBalancingType ¶
type LoadBalancingType string
LoadBalancingType Load Balancing type
var FastestResponseTime LoadBalancingType = "FastestResponseTime"
FastestResponseTime Assign each request to the node with the fastest response time.
var LeastConnections LoadBalancingType = "LeastConnections"
LeastConnections Assign each request to the node with the fewest connections.
var Perceptive LoadBalancingType = "Perceptive"
Perceptive Predict the most appropriate node using a combination of historical and current data.
var RandomNode LoadBalancingType = "RandomNode"
RandomNode Choose a random node for each request.
var RoundRobin LoadBalancingType = "RoundRobin"
RoundRobin Assign requests in turn to each node.
var WeightedLeastConnections LoadBalancingType = "WeightedLeastConnections"
WeightedLeastConnections Assign each request to a node based on the number of concurrent connections to the node and its weight.
var WeightedRoundRobin LoadBalancingType = "WeightedRoundRobin"
WeightedRoundRobin Assign requests in turn to each node, in proportion to their weights.
type Location ¶
type Location struct { Path string NameCondition map[string]*Condition // papping between backend name and condition }
Location -
type Meta ¶
type Meta struct { Index int64 `json:"index"` Name string `json:"name"` Namespace string `json:"namespace"` PluginName string `json:"plugin_name"` }
Meta Common meta
type Monitor ¶
type Monitor string
Monitor monitor type
var ConnectMonitor Monitor = "connect"
ConnectMonitor tcp connect monitor
var PingMonitor Monitor = "ping"
PingMonitor ping monitor
var SimpleHTTP Monitor = "simple http"
SimpleHTTP http monitor
var SimpleHTTPS Monitor = "simple https"
SimpleHTTPS http monitor
type Node ¶
type Node struct { Meta Host string `json:"host"` Port int32 `json:"port"` Protocol string `json:"protocol"` State string `json:"state"` //Active Draining Disabled PoolName string `json:"pool_name"` //Belong to the pool Ready bool `json:"ready"` //Whether ready Weight int `json:"weight"` MaxFails int `json:"max_fails"` FailTimeout string `json:"fail_timeout"` }
Node Application service endpoint
type Pool ¶
type Pool struct { Meta //application service id ServiceID string `json:"service_id"` //application service version ServiceVersion string `json:"service_version"` //application service port ServicePort int `json:"service_port"` //pool instructions Note string `json:"note"` NodeNumber int `json:"node_number"` LoadBalancingType LoadBalancingType `json:"load_balancing_type"` UpstreamHashBy string `json:"upstream_hash_by"` LeastConn bool `json:"least_conn"` Monitors []Monitor `json:"monitors"` Nodes []*Node }
Pool Application service endpoints pool
type Protocol ¶
type Protocol string
Protocol defines network protocols supported for things like container ports.
type RedirectConfig ¶
type RedirectConfig struct { URL string `json:"url"` Code int `json:"code"` FromToWWW bool `json:"fromToWWW"` }
RedirectConfig Config returns the redirect configuration for an rule
type SSLCert ¶
type SSLCert struct { *Meta CertificateStr string `json:"certificate_str"` Certificate *x509.Certificate `json:"certificate,omitempty"` PrivateKey string `json:"private_key"` CertificatePem string `json:"certificate_pem"` // CN contains all the common names defined in the SSL certificate CN []string `json:"cn"` // ExpiresTime contains the expiration of this SSL certificate in timestamp format ExpireTime time.Time `json:"expires"` }
SSLCert describes a SSL certificate
type VirtualService ¶
type VirtualService struct { Meta Enabled bool `json:"enable"` Protocol corev1.Protocol `json:"protocol"` // BackendProtocol indicates which protocol should be used to communicate with the service BackendProtocol string `json:"backend-protocol"` Port int32 `json:"port"` Listening []string `json:"listening"` //if Listening is nil,will listen all Note string `json:"note"` DefaultPoolName string `json:"default_pool_name"` RuleNames []string `json:"rule_names"` SSLdecrypt bool `json:"ssl_decrypt"` DefaultCertificateName string `json:"default_certificate_name"` RequestLogEnable bool `json:"request_log_enable"` RequestLogFileName string `json:"request_log_file_name"` RequestLogFormat string `json:"request_log_format"` //ConnectTimeout The time, in seconds, to wait for data from a new connection. If no data is received within this time, the connection will be closed. A value of 0 (zero) will disable the timeout. ConnectTimeout int `json:"connect_timeout"` //Timeout A connection should be closed if no additional data has been received for this period of time. A value of 0 (zero) will disable this timeout. Note that the default value may vary depending on the protocol selected. Timeout int `json:"timeout"` ServerName string `json:"server_name"` PoolName string `json:"pool_name"` SSLCert *SSLCert `json:"ssl_cert"` Locations []*Location `json:"locations"` ForceSSLRedirect bool `json:"force_ssl_redirect"` }
VirtualService VirtualService
func (*VirtualService) Equals ¶
func (v *VirtualService) Equals(c *VirtualService) bool