Documentation ¶
Overview ¶
Package server is default Server implements for different protocol.
Index ¶
- Constants
- func GetProcessPoolSize() int
- func RegistDefaultMessageHandlers(extFactory motan.ExtensionFactory)
- func RegistDefaultServers(extFactory motan.ExtensionFactory)
- func SetProcessPoolSize(size int)
- func WrapWithFilter(provider motan.Provider, extFactory motan.ExtensionFactory, ...) motan.Provider
- type DefaultExporter
- func (d *DefaultExporter) Available()
- func (d *DefaultExporter) Export(server motan.Server, extFactory motan.ExtensionFactory, context *motan.Context) (err error)
- func (d *DefaultExporter) GetProvider() motan.Provider
- func (d *DefaultExporter) GetRuntimeInfo() map[string]interface{}
- func (d *DefaultExporter) GetURL() *motan.URL
- func (d *DefaultExporter) IsAvailable() bool
- func (d *DefaultExporter) SetProvider(provider motan.Provider)
- func (d *DefaultExporter) SetURL(url *motan.URL)
- func (d *DefaultExporter) Unavailable()
- func (d *DefaultExporter) Unexport() error
- type DefaultMessageHandler
- func (d *DefaultMessageHandler) AddProvider(p motan.Provider) error
- func (d *DefaultMessageHandler) Call(request motan.Request) (res motan.Response)
- func (d *DefaultMessageHandler) GetName() string
- func (d *DefaultMessageHandler) GetProvider(serviceName string) motan.Provider
- func (d *DefaultMessageHandler) GetRuntimeInfo() map[string]interface{}
- func (d *DefaultMessageHandler) Initialize()
- func (d *DefaultMessageHandler) RmProvider(p motan.Provider)
- type FilterProviderWrapper
- func (f *FilterProviderWrapper) Call(request motan.Request) (res motan.Response)
- func (f *FilterProviderWrapper) Destroy()
- func (f *FilterProviderWrapper) GetPath() string
- func (f *FilterProviderWrapper) GetRuntimeInfo() map[string]interface{}
- func (f *FilterProviderWrapper) GetURL() *motan.URL
- func (f *FilterProviderWrapper) IsAvailable() bool
- func (f *FilterProviderWrapper) SetService(s interface{})
- func (f *FilterProviderWrapper) SetURL(url *motan.URL)
- type HTTPClusterGetter
- type HTTPProxyServer
- func (s *HTTPProxyServer) Destroy()
- func (s *HTTPProxyServer) GetHTTPClient() *fasthttp.Client
- func (s *HTTPProxyServer) GetName() string
- func (s *HTTPProxyServer) GetRuntimeInfo() map[string]interface{}
- func (s *HTTPProxyServer) GetURL() *core.URL
- func (s *HTTPProxyServer) Open(block bool, proxy bool, clusterGetter HTTPClusterGetter, ...) error
- func (s *HTTPProxyServer) SetURL(url *core.URL)
- type MotanServer
- func (m *MotanServer) Destroy()
- func (m *MotanServer) GetMessageHandler() motan.MessageHandler
- func (m *MotanServer) GetName() string
- func (m *MotanServer) GetRuntimeInfo() map[string]interface{}
- func (m *MotanServer) GetURL() *motan.URL
- func (m *MotanServer) Open(block bool, proxy bool, handler motan.MessageHandler, ...) error
- func (m *MotanServer) SetHeartbeat(enabled bool)
- func (m *MotanServer) SetMessageHandler(mh motan.MessageHandler)
- func (m *MotanServer) SetURL(url *motan.URL)
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 ¶
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 ¶
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)
Click to show internal directories.
Click to hide internal directories.