upstream_dto

package
v1.0.0-beta Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertUpstream

func ConvertUpstream(u *Upstream) *upstream.Config

func ToProxyHeaders

func ToProxyHeaders(p []*ProxyHeader) []*upstream.ProxyHeader

Types

type DiscoverConfig

type DiscoverConfig struct {
	Discover string `json:"discover"`
	Service  string `json:"service"`
}

type NodeConfig

type NodeConfig struct {
	Address string `json:"address"`
	Weight  int    `json:"weight"`
}

type ProxyHeader

type ProxyHeader struct {
	Key     string `json:"key"`
	Value   string `json:"value"`
	OptType string `json:"opt_type"`
}

func FromProxyHeaders

func FromProxyHeaders(p []*upstream.ProxyHeader) []*ProxyHeader

type Upstream

type Upstream struct {
	Type            string          `json:"driver"`
	Balance         string          `json:"balance"`
	Timeout         int             `json:"timeout"`
	Retry           int             `json:"retry"`
	Remark          string          `json:"remark"`
	LimitPeerSecond int             `json:"limit_peer_second"`
	ProxyHeaders    []*ProxyHeader  `json:"proxy_headers"`
	Scheme          string          `json:"scheme"`
	PassHost        string          `json:"pass_host"`
	UpstreamHost    string          `json:"upstream_host"`
	Nodes           []*NodeConfig   `json:"nodes"`
	Discover        *DiscoverConfig `json:"discover"`
}

func FromClusterConfig

func FromClusterConfig(c *upstream.Config) *Upstream

type UpstreamConfig

type UpstreamConfig *Upstream

Jump to

Keyboard shortcuts

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