route

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT 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 added in v0.2.0

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

type BalancerConfig added in v0.2.0

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

type BalancerSpec added in v0.2.0

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

type CertificateSpec added in v0.2.0

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

type IngressConfig added in v0.2.0

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

type IngressData added in v0.2.0

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

type IngressRouteSpec added in v0.2.0

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

type RouterConfig added in v0.2.0

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

type RouterSpec added in v0.2.0

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 added in v0.2.0

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

type TLSSpec added in v0.2.0

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 added in v0.2.0

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 added in v0.2.0

type UpstreamSpec struct {
	Protocol  string             `json:"proto,omitempty"`
	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