Documentation ¶
Index ¶
- Variables
- func CreateMeshToMeshConfig(clientaddr string, serveraddr string, appproto types.ProtocolName, ...) *v2.MOSNConfig
- func CreateProxyMesh(addr string, hosts []string, proto types.ProtocolName) *v2.MOSNConfig
- func CreateTCPProxyConfig(meshaddr string, hosts []string, isRouteEntryMode bool) *v2.MOSNConfig
- func CreateTLSExtensionConfig(clientaddr string, serveraddr string, appproto types.ProtocolName, ...) *v2.MOSNConfig
- func CreateXProtocolMesh(clientaddr string, serveraddr string, subProtocol types.ProtocolName, ...) *v2.MOSNConfig
- func CreateXProtocolProxyMesh(addr string, hosts []string, proto types.ProtocolName) *v2.MOSNConfig
- func CreateXWeightProxyMesh(addr string, proto types.ProtocolName, clusters []*WeightCluster) *v2.MOSNConfig
- func CreateXprotocolTLSExtensionConfig(clientaddr string, serveraddr string, subProtocol types.ProtocolName, ...) *v2.MOSNConfig
- func CurrentMeshAddr() string
- func IsMapEmpty(m *sync.Map) bool
- func NewBasicCluster(name string, hosts []string) v2.Cluster
- func NewFilterChain(routerConfigName string, downstream, upstream types.ProtocolName, ...) v2.FilterChain
- func NewHeaderRouter(cluster string, value string) v2.Router
- func NewHeaderWeightedRouter(clusters []v2.WeightedCluster, value string) v2.Router
- func NewListener(name, addr string, chains []v2.FilterChain) v2.Listener
- func NewMOSNConfig(listeners []v2.Listener, clusterManager v2.ClusterManagerConfig) *v2.MOSNConfig
- func NewPathRouter(cluster string, path string) v2.Router
- func NewPrefixRouter(cluster string, prefix string) v2.Router
- func NewProxyFilter(routerfgname string, downstream, upstream types.ProtocolName) *v2.Proxy
- func NewWeightedCluster(name string, hosts []*WeightHost) v2.Cluster
- func NewXProtocolFilterChain(name string, subProtocol types.ProtocolName, routers []v2.Router) v2.FilterChain
- func RandomDuration(min, max time.Duration) time.Duration
- func ServeRPC(t *testing.T, conn net.Conn, ...)
- func WaitMapEmpty(m *sync.Map, timeout time.Duration) bool
- type ExtendVerifyConfig
- type HTTP2Server
- type HTTPHandler
- type HTTPServer
- type RPCClient
- func (c *RPCClient) Close()
- func (c *RPCClient) Connect(addr string) error
- func (c *RPCClient) ConnectTLS(addr string, cfg *v2.TLSConfig) error
- func (c *RPCClient) OnDecodeError(context context.Context, err error, headers types.HeaderMap)
- func (c *RPCClient) OnReceive(ctx context.Context, headers types.HeaderMap, data types.IoBuffer, ...)
- func (c *RPCClient) SendRequest()
- func (c *RPCClient) SendRequestWithData(in string)
- func (c *RPCClient) Stats() bool
- type RPCServer
- type ServeConn
- type UpstreamServer
- func NewHTTPServer(t *testing.T, h http.Handler) UpstreamServer
- func NewRPCServer(t *testing.T, addr string, proto types.ProtocolName) UpstreamServer
- func NewUpstreamHTTP2(t *testing.T, addr string, h http.Handler) UpstreamServer
- func NewUpstreamServer(t *testing.T, addr string, serve ServeConn) UpstreamServer
- type WeightCluster
- type WeightHost
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MeshLogPath = "stdout" MeshLogLevel = "INFO" StartRetry = false )
can set
Functions ¶
func CreateMeshToMeshConfig ¶
func CreateMeshToMeshConfig(clientaddr string, serveraddr string, appproto types.ProtocolName, meshproto types.ProtocolName, hosts []string, tls bool) *v2.MOSNConfig
Mesh to Mesh clientaddr and serveraddr is mesh's addr appproto is client and server (not mesh) protocol meshproto is mesh's protocol hosts is server's addresses
func CreateProxyMesh ¶
func CreateProxyMesh(addr string, hosts []string, proto types.ProtocolName) *v2.MOSNConfig
mesh as a proxy , client and servre have same protocol
func CreateTCPProxyConfig ¶
func CreateTCPProxyConfig(meshaddr string, hosts []string, isRouteEntryMode bool) *v2.MOSNConfig
TCP Proxy
func CreateTLSExtensionConfig ¶
func CreateTLSExtensionConfig(clientaddr string, serveraddr string, appproto types.ProtocolName, meshproto types.ProtocolName, hosts []string, ext *ExtendVerifyConfig) *v2.MOSNConfig
func CreateXProtocolMesh ¶
func CreateXProtocolMesh(clientaddr string, serveraddr string, subProtocol types.ProtocolName, hosts []string, tls bool) *v2.MOSNConfig
XProtocol mesh to mesh currently, support Path/Prefix is "/" only
func CreateXProtocolProxyMesh ¶ added in v0.11.0
func CreateXProtocolProxyMesh(addr string, hosts []string, proto types.ProtocolName) *v2.MOSNConfig
XProtocol mesh as a proxy , client and servre have same protocol
func CreateXWeightProxyMesh ¶ added in v0.11.0
func CreateXWeightProxyMesh(addr string, proto types.ProtocolName, clusters []*WeightCluster) *v2.MOSNConfig
mesh as a proxy , client and servre have same protocol
func CreateXprotocolTLSExtensionConfig ¶ added in v0.11.0
func CreateXprotocolTLSExtensionConfig(clientaddr string, serveraddr string, subProtocol types.ProtocolName, hosts []string, ext *ExtendVerifyConfig) *v2.MOSNConfig
func CurrentMeshAddr ¶
func CurrentMeshAddr() string
func IsMapEmpty ¶
func NewFilterChain ¶
func NewFilterChain(routerConfigName string, downstream, upstream types.ProtocolName, routers []v2.Router) v2.FilterChain
func NewHeaderWeightedRouter ¶
func NewHeaderWeightedRouter(clusters []v2.WeightedCluster, value string) v2.Router
weighted cluster case
func NewListener ¶
func NewListener(name, addr string, chains []v2.FilterChain) v2.Listener
func NewMOSNConfig ¶
func NewMOSNConfig(listeners []v2.Listener, clusterManager v2.ClusterManagerConfig) *v2.MOSNConfig
func NewProxyFilter ¶
func NewProxyFilter(routerfgname string, downstream, upstream types.ProtocolName) *v2.Proxy
Create Mesh Config
func NewWeightedCluster ¶
func NewWeightedCluster(name string, hosts []*WeightHost) v2.Cluster
func NewXProtocolFilterChain ¶
func NewXProtocolFilterChain(name string, subProtocol types.ProtocolName, routers []v2.Router) v2.FilterChain
Types ¶
type ExtendVerifyConfig ¶
TLS Extension
type HTTP2Server ¶
type HTTPHandler ¶
type HTTPHandler struct{}
Server Implement
func (*HTTPHandler) ServeHTTP ¶
func (h *HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type HTTPServer ¶
Http Server
func (*HTTPServer) Addr ¶
func (s *HTTPServer) Addr() string
func (*HTTPServer) Close ¶
func (s *HTTPServer) Close()
func (*HTTPServer) GoServe ¶
func (s *HTTPServer) GoServe()
type RPCClient ¶
type RPCClient struct { ClientID string Protocol types.ProtocolName //bolt1, bolt2 Codec stream.Client Waits sync.Map ExpectedStatus int16 // contains filtered or unexported fields }
func NewRPCClient ¶
func (*RPCClient) OnDecodeError ¶
func (*RPCClient) SendRequest ¶
func (c *RPCClient) SendRequest()
func (*RPCClient) SendRequestWithData ¶
type RPCServer ¶
type RPCServer struct { UpstreamServer Client *RPCClient // Statistic Name string Count uint32 }
func (*RPCServer) ServeDubbo ¶ added in v0.11.0
type UpstreamServer ¶
type UpstreamServer interface { GoServe() Close() Addr() string }
func NewHTTPServer ¶
func NewHTTPServer(t *testing.T, h http.Handler) UpstreamServer
func NewRPCServer ¶
func NewRPCServer(t *testing.T, addr string, proto types.ProtocolName) UpstreamServer
func NewUpstreamHTTP2 ¶
func NewUpstreamServer ¶
func NewUpstreamServer(t *testing.T, addr string, serve ServeConn) UpstreamServer
type WeightCluster ¶
type WeightCluster struct { Name string Hosts []*WeightHost Weight uint32 }
type WeightHost ¶
Click to show internal directories.
Click to hide internal directories.