server

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 26 Imported by: 2

Documentation

Overview

Package server is default Server implements for different protocol.

Index

Constants

View Source
const (
	HTTPProxyServerName       = "motan"
	DefaultTimeout            = 5 * time.Second
	DefaultKeepaliveTimeout   = 5 * time.Second
	DefaultMaxRequestBodySize = math.MaxInt32
)
View Source
const (
	HTTPProxyKeepaliveKey          = "httpProxyKeepalive"
	HTTPProxyKeepaliveTimeoutKey   = "httpProxyKeepaliveTimeout"
	HTTPProxyDefaultDomainKey      = "httpProxyDefaultDomain"
	HTTPProxyTimeoutKey            = "httpProxyTimeout"
	HTTPProxyMaxRequestBodySizeKey = "httpProxyMaxRequestBodySize"
	HTTPProxyEnableKey             = "httpProxyEnable"
)
View Source
const (
	Motan2 = "motan2"
	Motan  = "motan"
	CGI    = "cgi"
)
View Source
const (
	Default = "default"
)

Variables

This section is empty.

Functions

func GetProcessPoolSize added in v1.1.0

func GetProcessPoolSize() int

func RegistDefaultMessageHandlers

func RegistDefaultMessageHandlers(extFactory motan.ExtensionFactory)

func RegistDefaultServers

func RegistDefaultServers(extFactory motan.ExtensionFactory)

func SetProcessPoolSize added in v1.1.0

func SetProcessPoolSize(size int)

func WrapWithFilter

func WrapWithFilter(provider motan.Provider, extFactory motan.ExtensionFactory, context *motan.Context) motan.Provider

Types

type DefaultExporter

type DefaultExporter struct {
	Registries []motan.Registry
	// contains filtered or unexported fields
}

func (*DefaultExporter) Available

func (d *DefaultExporter) Available()

func (*DefaultExporter) Export

func (d *DefaultExporter) Export(server motan.Server, extFactory motan.ExtensionFactory, context *motan.Context) (err error)

func (*DefaultExporter) GetProvider

func (d *DefaultExporter) GetProvider() motan.Provider

func (*DefaultExporter) GetRuntimeInfo added in v1.2.0

func (d *DefaultExporter) GetRuntimeInfo() map[string]interface{}

func (*DefaultExporter) GetURL

func (d *DefaultExporter) GetURL() *motan.URL

func (*DefaultExporter) IsAvailable

func (d *DefaultExporter) IsAvailable() bool

func (*DefaultExporter) SetProvider

func (d *DefaultExporter) SetProvider(provider motan.Provider)

func (*DefaultExporter) SetURL

func (d *DefaultExporter) SetURL(url *motan.URL)

func (*DefaultExporter) Unavailable

func (d *DefaultExporter) Unavailable()

func (*DefaultExporter) Unexport

func (d *DefaultExporter) Unexport() error

type DefaultMessageHandler

type DefaultMessageHandler struct {
	// contains filtered or unexported fields
}

func (*DefaultMessageHandler) AddProvider

func (d *DefaultMessageHandler) AddProvider(p motan.Provider) error

func (*DefaultMessageHandler) Call

func (d *DefaultMessageHandler) Call(request motan.Request) (res motan.Response)

func (*DefaultMessageHandler) GetName added in v1.2.0

func (d *DefaultMessageHandler) GetName() string

func (*DefaultMessageHandler) GetProvider

func (d *DefaultMessageHandler) GetProvider(serviceName string) motan.Provider

func (*DefaultMessageHandler) GetRuntimeInfo added in v1.2.0

func (d *DefaultMessageHandler) GetRuntimeInfo() map[string]interface{}

func (*DefaultMessageHandler) Initialize

func (d *DefaultMessageHandler) Initialize()

func (*DefaultMessageHandler) RmProvider

func (d *DefaultMessageHandler) RmProvider(p motan.Provider)

type FilterProviderWrapper

type FilterProviderWrapper struct {
	// contains filtered or unexported fields
}

func (*FilterProviderWrapper) Call

func (f *FilterProviderWrapper) Call(request motan.Request) (res motan.Response)

func (*FilterProviderWrapper) Destroy

func (f *FilterProviderWrapper) Destroy()

func (*FilterProviderWrapper) GetPath

func (f *FilterProviderWrapper) GetPath() string

func (*FilterProviderWrapper) GetRuntimeInfo added in v1.2.0

func (f *FilterProviderWrapper) GetRuntimeInfo() map[string]interface{}

func (*FilterProviderWrapper) GetURL

func (f *FilterProviderWrapper) GetURL() *motan.URL

func (*FilterProviderWrapper) IsAvailable

func (f *FilterProviderWrapper) IsAvailable() bool

func (*FilterProviderWrapper) SetService

func (f *FilterProviderWrapper) SetService(s interface{})

func (*FilterProviderWrapper) SetURL

func (f *FilterProviderWrapper) SetURL(url *motan.URL)

type HTTPClusterGetter

type HTTPClusterGetter interface {
	GetHTTPCluster(host string) *cluster.HTTPCluster
}

type HTTPProxyServer

type HTTPProxyServer struct {
	// contains filtered or unexported fields
}

func NewHTTPProxyServer

func NewHTTPProxyServer(url *core.URL) *HTTPProxyServer

func (*HTTPProxyServer) Destroy

func (s *HTTPProxyServer) Destroy()

func (*HTTPProxyServer) GetHTTPClient

func (s *HTTPProxyServer) GetHTTPClient() *fasthttp.Client

func (*HTTPProxyServer) GetName

func (s *HTTPProxyServer) GetName() string

func (*HTTPProxyServer) GetRuntimeInfo added in v1.2.0

func (s *HTTPProxyServer) GetRuntimeInfo() map[string]interface{}

func (*HTTPProxyServer) GetURL

func (s *HTTPProxyServer) GetURL() *core.URL

func (*HTTPProxyServer) Open

func (s *HTTPProxyServer) Open(block bool, proxy bool, clusterGetter HTTPClusterGetter, messageHandler core.MessageHandler) error

func (*HTTPProxyServer) SetURL

func (s *HTTPProxyServer) SetURL(url *core.URL)

type MotanServer

type MotanServer struct {
	URL *motan.URL
	// contains filtered or unexported fields
}

func (*MotanServer) Destroy

func (m *MotanServer) Destroy()

func (*MotanServer) GetMessageHandler

func (m *MotanServer) GetMessageHandler() motan.MessageHandler

func (*MotanServer) GetName

func (m *MotanServer) GetName() string

func (*MotanServer) GetRuntimeInfo added in v1.2.0

func (m *MotanServer) GetRuntimeInfo() map[string]interface{}

func (*MotanServer) GetURL

func (m *MotanServer) GetURL() *motan.URL

func (*MotanServer) Open

func (m *MotanServer) Open(block bool, proxy bool, handler motan.MessageHandler, extFactory motan.ExtensionFactory) error

func (*MotanServer) SetHeartbeat added in v1.1.0

func (m *MotanServer) SetHeartbeat(enabled bool)

SetHeartbeat true: enable heartbeat, false: disable heartbeat

func (*MotanServer) SetMessageHandler

func (m *MotanServer) SetMessageHandler(mh motan.MessageHandler)

func (*MotanServer) SetURL

func (m *MotanServer) SetURL(url *motan.URL)

Jump to

Keyboard shortcuts

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