Back to godoc.org

Package v1

v5.2.0-release+incompa...
Latest Go to latest

The latest major version is .

Published: Apr 16, 2020 | License: LGPL-3.0 | Module: github.com/goodrain/rainbond

Index

type Condition

type Condition struct {
	Type  ConditionType
	Value map[string]string
}

Condition is the condition that the traffic can reach the specified backend

func (*Condition) Equals

func (c *Condition) Equals(cc *Condition) bool

Equals determines if two conditions are equal

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

func (*Config) Equals

func (cfg *Config) Equals(c *Config) bool

Equals determines if cfg is equal to c

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
	// Rewrite describes the redirection this location.
	// +optional
	Rewrite rewrite.Config `json:"rewrite,omitempty"`
	// Proxy contains information about timeouts and buffer sizes
	// to be used in connections against endpoints
	// +optional
	Proxy            proxy.Config `json:"proxy,omitempty"`
	DisableProxyPass bool
}

Location -

func (*Location) Equals

func (l *Location) Equals(c *Location) bool

Equals determines if two locations are equal

type Meta

type Meta struct {
	Index      int64  `json:"index"`
	Name       string `json:"name"`
	Namespace  string `json:"namespace"`
	ServiceID  string `json:"service_id"`
	PluginName string `json:"plugin_name"`
}

Meta Common meta

func (*Meta) Equals

func (m *Meta) Equals(c *Meta) bool

Equals -

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

func (*Node) Equals

func (n *Node) Equals(c *Node) bool

Equals -

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           `json:"nodes"`
}

Pool Application service endpoints pool

func (*Pool) Equals

func (p *Pool) Equals(c *Pool) bool

Equals -

type Protocol

type Protocol string

Protocol defines network protocols supported for things like container ports.

const (
	// ProtocolTCP is the TCP protocol.
	ProtocolTCP Protocol = "TCP"
	// ProtocolUDP is the UDP protocol.
	ProtocolUDP Protocol = "UDP"
	// ProtocolSCTP is the SCTP protocol.
	ProtocolSCTP Protocol = "SCTP"
)

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

func (*SSLCert) Equals

func (s *SSLCert) Equals(c *SSLCert) bool

Equals -

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"`
	ExtensionConfig  map[string]interface{} `json:"extension_config"`
}

VirtualService VirtualService

func (*VirtualService) Equals

func (v *VirtualService) Equals(c *VirtualService) bool

Equals equals vs

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier