traffic_split

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithOverride

func WithOverride(r *http.Request, override *Override) *http.Request

Types

type Config

type Config struct {
	Rules       []Rule `json:"rules,omitempty"`
	MaxBodySize int    `json:"max_body_size,omitempty"`
}

type Match

type Match struct {
	Vars []any `json:"vars,omitempty"`
}

type Node

type Node struct {
	Host   string `json:"host,omitempty"`
	Port   int    `json:"port,omitempty"`
	Weight int    `json:"weight,omitempty"`
	// contains filtered or unexported fields
}

func (*Node) UnmarshalJSON

func (n *Node) UnmarshalJSON(data []byte) error

type Override

type Override struct {
	Scheme         string
	Host           string
	PassHost       string
	UpstreamHost   string
	Timeout        resource.Timeout
	Retries        int
	NextRetry      func() *Override
	HealthReporter pxy.HealthReporter
	HealthTarget   string
}

func GetOverride

func GetOverride(r *http.Request) *Override

type Plugin

type Plugin struct {
	base.BasePlugin
	// contains filtered or unexported fields
}

func (*Plugin) Config

func (p *Plugin) Config() any

func (*Plugin) Handler

func (p *Plugin) Handler(next http.Handler) http.Handler

func (*Plugin) Init

func (p *Plugin) Init() error

func (*Plugin) PostInit

func (p *Plugin) PostInit() error

type Rule

type Rule struct {
	Match             []Match            `json:"match,omitempty"`
	WeightedUpstreams []WeightedUpstream `json:"weighted_upstreams,omitempty"`
}

type Upstream

type Upstream struct {
	Type         string           `json:"type,omitempty"`
	Scheme       string           `json:"scheme,omitempty"`
	PassHost     string           `json:"pass_host,omitempty"`
	UpstreamHost string           `json:"upstream_host,omitempty"`
	HashOn       string           `json:"hash_on,omitempty"`
	Key          string           `json:"key,omitempty"`
	Timeout      resource.Timeout `json:"timeout"`
	Retries      int              `json:"retries,omitempty"`

	Checks map[string]any `json:"checks,omitempty"`
	Nodes  []Node         `json:"nodes,omitempty"`
	// contains filtered or unexported fields
}

func (*Upstream) UnmarshalJSON

func (u *Upstream) UnmarshalJSON(data []byte) error

type WeightedUpstream

type WeightedUpstream struct {
	UpstreamID string    `json:"upstream_id,omitempty"`
	Upstream   *Upstream `json:"upstream,omitempty"`
	Weight     int       `json:"weight,omitempty"`
	// contains filtered or unexported fields
}

func (*WeightedUpstream) UnmarshalJSON

func (w *WeightedUpstream) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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