route

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package route defines the route types

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BalancerConfig

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

BalancerConfig is the data structure for balancer config

type BalancerSpec

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

BalancerSpec is the data structure for balancer spec

type CertificateSpec

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

CertificateSpec is the data structure for certificate spec

type IngressConfig

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

IngressConfig is the data structure for ingress config

type IngressData

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

IngressData is the data structure for ingress routes

type IngressRouteSpec

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

IngressRouteSpec is the data structure for ingress route spec

type RouterConfig

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

RouterConfig is the data structure for router config

type RouterSpec

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

RouterSpec is the data structure for router spec

type ServiceRegistry

type ServiceRegistry struct {
	Services ServiceRegistryEntry `json:"services"`
}

ServiceRegistry is the data structure for service registry

type ServiceRegistryEntry

type ServiceRegistryEntry map[string][]string

ServiceRegistryEntry is the data structure for service registry entry

type ServiceRoute

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

ServiceRoute is the data structure for service routes

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"`
}

ServiceRouteEntry is the data structure for service route entry

type TLSConfig

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

TLSConfig is the data structure for TLS config

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"`
}

TLSSpec is the data structure for TLS spec

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 further features
	Tags map[string]string `json:"tags,omitempty" hash:"set"`
}

Target is the data structure for target

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"`
}

UpstreamEndpoint is the data structure for upstream endpoint

type UpstreamSpec

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"`
}

UpstreamSpec is the data structure for upstream spec

Jump to

Keyboard shortcuts

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