upstream

package
v1.3.1-beta Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

type DiscoverConfig

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

type IUpstreamService

type IUpstreamService interface {
	Get(ctx context.Context, id string) (*Upstream, error)
	Save(ctx context.Context, upstream *SaveUpstream) error
	Delete(ctx context.Context, id string) error
	List(ctx context.Context, serviceIds ...string) ([]*Upstream, error)
	LatestCommit(ctx context.Context, uid string, clusterId string) (*commit.Commit[Config], error)
	ListLatestCommit(ctx context.Context, clusterId string, serviceIds ...string) ([]*commit.Commit[Config], error)
	SaveCommit(ctx context.Context, uid string, partition string, cfg *Config) error
	GetCommit(ctx context.Context, uuid string) (*commit.Commit[Config], error)
	ListCommit(ctx context.Context, uuid ...string) ([]*commit.Commit[Config], error)
}

type Item

type Item struct {
	UUID       string
	Name       string
	Type       string
	Service    string
	Team       string
	Creator    string
	Updater    string
	Remark     string
	CreateTime time.Time
	UpdateTime time.Time
}

type NodeConfig

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

type ProxyHeader

type ProxyHeader struct {
	Key     string `json:"key,omitempty"`
	Value   string `json:"value,omitempty"`
	OptType string `json:"optType,omitempty"`
}

type SaveUpstream

type SaveUpstream struct {
	UUID    string
	Name    string
	Service string
	Team    string
	Remark  string
}

type Upstream

type Upstream struct {
	*Item
}

Jump to

Keyboard shortcuts

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