proxy

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BehaviorStatusFound : プロキシの宛先が見つかった
	BehaviorStatusFound = "found"
	// BehaviorStatusNotFound : プロキシの宛先が見つからなった
	BehaviorStatusNotFound = "notfound"
)
View Source
const (
	// ProxyHeaderBehavior : プロキシの結果を格納するヘッダの名前
	ProxyHeaderBehavior = "X-Proxy-Behavior"
	// ProxyHeaderControl : プロキシのコントローラを呼び出すためのヘッダの名前
	ProxyHeaderControl = "X-Proxy-Control"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	PathPrefix string `json:"-" yaml:"pathPrefix"`
}

API : コントロールの設定

type Behavior

type Behavior struct {
	PathPrefix string `json:"pathPrefix" yaml:"pathPrefix"`
	OriginKey  string `json:"originKey" yaml:"originKey"`
}

Behavior : パスごとのプロキシ先設定

type Endpoint

type Endpoint struct {
	Key string `json:"key" yaml:"key"`
	URL string `json:"url" yaml:"url"`
}

type Handler

type Handler struct {
	Origins   []*Origin  `json:"origins" yaml:"origins"`
	Behaviors []Behavior `json:"behaviors" yaml:"behaviors"`
	Addr      string     `json:"-" yaml:"addr"`
	API       API        `json:"-" yaml:"api"`

	StartPath   string `json:"-" yaml:"startPath"`
	HideControl bool   `json:"-" yaml:"hideControl"`
	// contains filtered or unexported fields
}

Handler : リバースプロキシ

func (*Handler) ListenAndServe

func (h *Handler) ListenAndServe() error

ListenAndServe : サーバーを起動する

type Origin

type Origin struct {
	Name      string     `json:"name" yaml:"name"`
	Endpoints []Endpoint `json:"endpoints" yaml:"endpoints"`

	EndpointKey string `json:"endpointKey" yaml:"endpointKey"`
	EndpointURL string `json:"endpointURL" yaml:"-"`
	// contains filtered or unexported fields
}

Origin : プロキシ先の設定

func (*Origin) Init

func (o *Origin) Init()

func (*Origin) Select

func (o *Origin) Select(key string) bool

Jump to

Keyboard shortcuts

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