route

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlgoBalancer

type AlgoBalancer string
const (
	RoundRobinLoadBalancer AlgoBalancer = "round-robin"
	HashingLoadBalancer    AlgoBalancer = "hashing"
	LeastWorkLoadBalancer  AlgoBalancer = "least-work"
)

type BalancerConfig

type BalancerConfig struct {
	Services map[string]BalancerSpec `json:"services"`
}

type BalancerSpec

type BalancerSpec struct {
	Sticky   bool          `json:"sticky,omitempty"`
	Balancer AlgoBalancer  `json:"balancer,omitempty"`
	Upstream *UpstreamSpec `json:"upstream,omitempty"`
}

type CertificateSpec

type CertificateSpec struct {
	Cert string `json:"cert"`
	Key  string `json:"key"`
	CA   string `json:"ca,omitempty"`
}

type IngressConfig

type IngressConfig struct {
	TrustedCAs     []string `json:"trustedCAs"`
	TLSConfig      `json:",inline"`
	RouterConfig   `json:",inline"`
	BalancerConfig `json:",inline"`
}

type IngressData

type IngressData struct {
	//RouteBase `json:",inline"`
	// Hash
	Hash string `json:"hash" hash:"ignore"`
	// Routes
	Routes []IngressRouteSpec `json:"routes" hash:"set"`
}

type IngressRouteSpec

type IngressRouteSpec struct {
	RouterSpec   `json:",inline"`
	BalancerSpec `json:",inline"`
	TLSSpec      `json:",inline"`
}

type RouterConfig

type RouterConfig struct {
	Routes map[string]RouterSpec `json:"routes"`
}

type RouterSpec

type RouterSpec struct {
	Host    string   `json:"-"`
	Path    string   `json:"-"`
	Service string   `json:"service,omitempty"`
	Rewrite []string `json:"rewrite,omitempty"`
}

type ServiceRoute

type ServiceRoute struct {
	//RouteBase `json:",inline"`
	// Hash
	Hash   string              `json:"hash" hash:"ignore"`
	Routes []ServiceRouteEntry `json:"routes" hash:"set"`
}

type ServiceRouteEntry

type ServiceRouteEntry struct {
	// Name, the name of the service
	Name string `json:"name"`
	// Namespace, the namespace of the service, it has value no matter in cluster/out cluster, but will only be used for in-cluster
	Namespace string `json:"namespace"`
	// Targets
	Targets []Target `json:"targets" hash:"set"`
	// PortName
	PortName string `json:"portName,omitempty"`
}

type TLSConfig

type TLSConfig struct {
	Certificates map[string]TLSSpec `json:"certificates"`
}

type TLSSpec

type TLSSpec struct {
	IsTLS          bool             `json:"isTLS,omitempty"`
	IsWildcardHost bool             `json:"isWildcardHost,omitempty"`
	VerifyClient   bool             `json:"verifyClient,omitempty"`
	VerifyDepth    int              `json:"verifyDepth,omitempty"`
	Certificate    *CertificateSpec `json:"certificate,omitempty"`
	TrustedCA      *CertificateSpec `json:"trustedCA,omitempty"`
}

type Target

type Target struct {
	// Address can be IP address if in the same cluster, or ingress address for out cluster route
	Address string `json:"address"`
	// Tag, reserved placeholder for futher features
	Tags map[string]string `json:"tags,omitempty" hash:"set"`
}

type UpstreamEndpoint

type UpstreamEndpoint struct {
	// IP is the entry's IP.  The IP address protocol corresponds to the HashFamily of IPSet.
	// All entries' IP addresses in the same ip set has same the protocol, IPv4 or IPv6.
	IP string `json:"ip,omitempty"`
	// Port is the entry's Port.
	Port int `json:"port,omitempty"`
	// Protocol is the entry's Protocol.  The protocols of entries in the same ip set are all
	// the same.  The accepted protocols are TCP, UDP and SCTP.
	Protocol string `json:"protocol,omitempty"`
}

type UpstreamSpec

type UpstreamSpec struct {
	SSLName   string             `json:"sslName,omitempty"`
	SSLCert   *CertificateSpec   `json:"sslCert,omitempty"`
	SSLVerify bool               `json:"sslVerify,omitempty"`
	Endpoints []UpstreamEndpoint `json:"endpoints,omitempty" hash:"set"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL