route

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnType

type ConnType int

ConnType specifies the connection type

const (
	// HTTP - Connect to an endpoint with the http protocol
	HTTP ConnType = 0
	// HTTPS_VERIFY - Connect to an endpoint with the https protocol
	HTTPS_VERIFY ConnType = 1
	// HTTPS_SKIP_VERIFY - Connect to an endpoint with the https protocol (without verifying the server identity)
	HTTPS_SKIP_VERIFY ConnType = 2
	// REDIRECT - Redirect to the provided address
	REDIRECT ConnType = 3
	// LOAD_BALANCER - Load balancer mode
	LOAD_BALANCER ConnType = 4
)

func ParseConnType added in v1.4.0

func ParseConnType(v string) ConnType

type HealthCheckConfig

type HealthCheckConfig struct {
	// Delay in seconds
	Delay int    `json:"delay"`
	Path  string `json:"path"`
}

type LoadBalancerConfig

type LoadBalancerConfig struct {
	//HeathCheck *HealthCheckConfig `json:"health_check,omitempty"` // TODO
	Targets []LoadBalancerTargetCfg `json:"targets" yaml:"targets"`
}

type LoadBalancerTargetCfg

type LoadBalancerTargetCfg struct {
	Path string `json:"path" yaml:"path"`
}

type Route

type Route struct {
	Domain      string           `json:"domain" yaml:"domain"`
	Server      RouteServer      `json:"server" yaml:"server"`
	Certificate util.Certificate `json:"certificate" yaml:"certificate"`
	Autocert    bool             `json:"autocert" yaml:"autocert"`
	WsCFG       util.WsConfig    `json:"wscfg" yaml:"wscfg"`

	AuthMode      string `json:"auth_mode" yaml:"auth_mode"`
	AuthKey       string `json:"auth_key" yaml:"auth_key"`
	AuthValue     string `json:"auth_value" yaml:"auth_value"`
	ForceHTTPS    bool   `json:"force_https" yaml:"force_https"`
	FlushInterval int    `json:"flush_interval" yaml:"flush_interval"`
	// contains filtered or unexported fields
}

func (*Route) ReverseProxy

func (rt *Route) ReverseProxy(w http.ResponseWriter, r *http.Request)

ReverseProxy will route all requests for this route configuration

func (*Route) SetupWsCfgDefaults added in v1.4.3

func (r *Route) SetupWsCfgDefaults()

type RouteServer

type RouteServer struct {
	OutConnType  ConnType            `json:"out_conn_type" yaml:"out_conn_type"`
	OutAddress   string              `json:"out_address,omitempty" yaml:"out_address"`
	LoadBalancer *LoadBalancerConfig `json:"load_balancer,omitempty" yaml:"load_balancer"`
}

func (*RouteServer) URL

func (rs *RouteServer) URL() *url.URL

Jump to

Keyboard shortcuts

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