proxy

package
v0.0.0-...-206c9bf Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DelHost

func DelHost(hostname string) error

删除主机

func DelService

func DelService(serviceID string) error

func DeleteRoute

func DeleteRoute(routeGroupID, routePath, routeMethod string) error

删除路由

func OutputJSON

func OutputJSON() ([]byte, error)

所有数据输出成json

func SetHost

func SetHost(hostname string, host global.HostType) error

写入主机,如果存在则覆盖,不存在则创建

func SetRoute

func SetRoute(routeGroupID, routePath, routeMethod, serviceID string) error

设置路由组及路由

func SetService

func SetService(service global.ServiceType) error

Types

type Data

type Data struct {
	Hosts    map[string]global.HostType    `json:"hosts,omitempty"`
	Routes   map[string]string             `json:"routes,omitempty"`
	Services map[string]global.ServiceType `json:"services,omitempty"`
}

func (Data) MarshalEasyJSON

func (v Data) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Data) MarshalJSON

func (v Data) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Data) UnmarshalEasyJSON

func (v *Data) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Data) UnmarshalJSON

func (v *Data) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Engine

type Engine struct{}

代理引擎

func (*Engine) ServeHTTP

func (*Engine) ServeHTTP(resp http.ResponseWriter, req *http.Request)

实现http.Handler接口的方法 下游请求入口

Jump to

Keyboard shortcuts

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