Documentation
¶
Overview ¶
Motan-go is the golang implementation of Motan. Motan is a cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.
Motan-go includes server, client and agent. agent is designed for interpreted languages such as PHP to support service governance.
Index ¶
- func AddDefaultExt(d motan.ExtentionFactory)
- func GetDefaultExtFactory() motan.ExtentionFactory
- type Agent
- type AgentListener
- type Client
- func (c *Client) BaseCall(req motan.Request, reply interface{}) error
- func (c *Client) BaseGo(req motan.Request, reply interface{}, done chan *motan.AsyncResult) *motan.AsyncResult
- func (c *Client) BuildRequest(method string, args []interface{}) motan.Request
- func (c *Client) Call(method string, args []interface{}, reply interface{}) error
- func (c *Client) Go(method string, args []interface{}, reply interface{}, ...) *motan.AsyncResult
- type MCContext
- type MSContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDefaultExt ¶
func AddDefaultExt(d motan.ExtentionFactory)
func GetDefaultExtFactory ¶
func GetDefaultExtFactory() motan.ExtentionFactory
Types ¶
type Agent ¶
type Agent struct { ConfigFile string Context *motan.Context // contains filtered or unexported fields }
func NewAgent ¶
func NewAgent(extfactory motan.ExtentionFactory) *Agent
func (*Agent) RegisterManageHandler ¶
func (*Agent) SetSanpshotConf ¶
func (a *Agent) SetSanpshotConf()
func (*Agent) StartMotanAgent ¶
func (a *Agent) StartMotanAgent()
func (*Agent) StatusChangeHandler ¶
func (a *Agent) StatusChangeHandler(w http.ResponseWriter, r *http.Request)
StatusChangeHandler change agent server status, and set registed services available or unavailable.
type AgentListener ¶
type AgentListener struct { CurrentCommandInfo string // contains filtered or unexported fields }
func (*AgentListener) GetIdentity ¶
func (a *AgentListener) GetIdentity() string
func (*AgentListener) NotifyCommand ¶
func (a *AgentListener) NotifyCommand(registryURL *motan.URL, commandType int, commandInfo string)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) BaseGo ¶
func (c *Client) BaseGo(req motan.Request, reply interface{}, done chan *motan.AsyncResult) *motan.AsyncResult
func (*Client) BuildRequest ¶
func (*Client) Go ¶
func (c *Client) Go(method string, args []interface{}, reply interface{}, done chan *motan.AsyncResult) *motan.AsyncResult
type MCContext ¶
type MCContext struct {
// contains filtered or unexported fields
}
func GetClientContext ¶
func (*MCContext) Initialize ¶
func (m *MCContext) Initialize()
func (*MCContext) Start ¶
func (m *MCContext) Start(extfactory motan.ExtentionFactory)
type MSContext ¶
type MSContext struct {
// contains filtered or unexported fields
}
MSContext is Motan Server Context
func GetMotanServerContext ¶
GetMotanServerContext start a motan server context by config a motan server context can listen multi ports and provide many services. so a single motan server context is suggested default context will be used if confFile is empty
func (*MSContext) Initialize ¶
func (m *MSContext) Initialize()
func (*MSContext) RegisterService ¶
RegisterService register service with serviceId for config ref. the type.string will used as serviceId if sid is not set. e.g. 'packageName.structName'
func (*MSContext) ServicesAvailable ¶
func (m *MSContext) ServicesAvailable()
ServicesAvailable will enable all service registed in registries
func (*MSContext) ServicesUnavailable ¶
func (m *MSContext) ServicesUnavailable()
ServicesUnavailable will enable all service registed in registries
func (*MSContext) Start ¶
func (m *MSContext) Start(extfactory motan.ExtentionFactory)
Directories
¶
Path | Synopsis |
---|---|
Package cluster contains Cluster implement and command process.
|
Package cluster contains Cluster implement and command process. |
Package core is motan-go base package.
|
Package core is motan-go base package. |
Package endpoint is transport implement of different protocol.
|
Package endpoint is transport implement of different protocol. |
Package filter is some default filter implements.
|
Package filter is some default filter implements. |
Package ha is default HaStrategy implements.
|
Package ha is default HaStrategy implements. |
Package lb is default LoadBalance implements.
|
Package lb is default LoadBalance implements. |
Package protocol is motan2 protocol codec implements.
|
Package protocol is motan2 protocol codec implements. |
Package provider is default Provider implements.
|
Package provider is default Provider implements. |
Package registry is default registry implements.
|
Package registry is default registry implements. |
Package serialize is default serialization implements.
|
Package serialize is default serialization implements. |
Package server is default Server implements for different protocol.
|
Package server is default Server implements for different protocol. |