Documentation ¶
Overview ¶
Package provider is default Provider implements.
Index ¶
- Constants
- Variables
- func ParseFastCgiResponse(content string) (int, map[string]string, string, error)
- func RegistDefaultProvider(extFactory motan.ExtentionFactory)
- type CgiProvider
- func (c *CgiProvider) Call(request motan.Request) motan.Response
- func (c *CgiProvider) Destroy()
- func (c *CgiProvider) GetName() string
- func (c *CgiProvider) GetPath() string
- func (c *CgiProvider) GetURL() *motan.URL
- func (c *CgiProvider) Initialize()
- func (c *CgiProvider) IsAvailable() bool
- func (c *CgiProvider) SetProxy(proxy bool)
- func (c *CgiProvider) SetSerialization(s motan.Serialization)
- func (c *CgiProvider) SetService(s interface{})
- func (c *CgiProvider) SetURL(url *motan.URL)
- type DefaultProvider
- func (d *DefaultProvider) Call(request motan.Request) (res motan.Response)
- func (d *DefaultProvider) Destroy()
- func (d *DefaultProvider) GetPath() string
- func (d *DefaultProvider) GetURL() *motan.URL
- func (d *DefaultProvider) Initialize()
- func (d *DefaultProvider) IsAvailable() bool
- func (d *DefaultProvider) SetService(s interface{})
- func (d *DefaultProvider) SetURL(url *motan.URL)
- type HTTPProvider
- func (h *HTTPProvider) Call(request motan.Request) motan.Response
- func (h *HTTPProvider) Destroy()
- func (h *HTTPProvider) GetMixVars() []string
- func (h *HTTPProvider) GetName() string
- func (h *HTTPProvider) GetPath() string
- func (h *HTTPProvider) GetURL() *motan.URL
- func (h *HTTPProvider) Initialize()
- func (h *HTTPProvider) IsAvailable() bool
- func (h *HTTPProvider) SetContext(context *motan.Context)
- func (h *HTTPProvider) SetMixVars(mixVars []string)
- func (h *HTTPProvider) SetProxy(proxy bool)
- func (h *HTTPProvider) SetSerialization(s motan.Serialization)
- func (h *HTTPProvider) SetService(s interface{})
- func (h *HTTPProvider) SetURL(url *motan.URL)
- type MockProvider
- func (m *MockProvider) Call(request motan.Request) motan.Response
- func (m *MockProvider) Destroy()
- func (m *MockProvider) GetName() string
- func (m *MockProvider) GetPath() string
- func (m *MockProvider) GetURL() *motan.URL
- func (m *MockProvider) Initialize()
- func (m *MockProvider) IsAvailable() bool
- func (m *MockProvider) SetProxy(proxy bool)
- func (m *MockProvider) SetSerialization(s motan.Serialization)
- func (m *MockProvider) SetService(s interface{})
- func (m *MockProvider) SetURL(url *motan.URL)
Constants ¶
View Source
const ( CGIKeyPrefix = "CGI_" DefaultCGIHost = "127.0.0.1" DefaultCGIPort = 9000 HTTPMethodPOST = "POST" HTTPMethodGET = "GET" )
View Source
const ( // DefaultMotanMethodConfKey for default motan method conf, when make a http call without a specific motan method DefaultMotanMethodConfKey = "http_default_motan_method" // DefaultMotanHTTPMethod set a default http method DefaultMotanHTTPMethod = "GET" // MotanRequestHTTPMethodKey http method key in a motan request attachment MotanRequestHTTPMethodKey = "HTTP_Method" )
View Source
const ( CGI = "cgi" HTTP = "http" Mock = "mockProvider" Default = "default" )
ext name
Variables ¶
View Source
var NeededCGIEnv = []string{"REQUEST_METHOD", "SCRIPT_FILENAME", "DOCUMENT_ROOT"}
Functions ¶
func ParseFastCgiResponse ¶
func RegistDefaultProvider ¶
func RegistDefaultProvider(extFactory motan.ExtentionFactory)
Types ¶
type CgiProvider ¶
type CgiProvider struct {
// contains filtered or unexported fields
}
func (*CgiProvider) Destroy ¶
func (c *CgiProvider) Destroy()
func (*CgiProvider) GetName ¶
func (c *CgiProvider) GetName() string
func (*CgiProvider) GetPath ¶
func (c *CgiProvider) GetPath() string
func (*CgiProvider) GetURL ¶
func (c *CgiProvider) GetURL() *motan.URL
func (*CgiProvider) Initialize ¶
func (c *CgiProvider) Initialize()
func (*CgiProvider) IsAvailable ¶
func (c *CgiProvider) IsAvailable() bool
func (*CgiProvider) SetProxy ¶
func (c *CgiProvider) SetProxy(proxy bool)
func (*CgiProvider) SetSerialization ¶
func (c *CgiProvider) SetSerialization(s motan.Serialization)
func (*CgiProvider) SetService ¶
func (c *CgiProvider) SetService(s interface{})
func (*CgiProvider) SetURL ¶
func (c *CgiProvider) SetURL(url *motan.URL)
type DefaultProvider ¶
type DefaultProvider struct {
// contains filtered or unexported fields
}
func (*DefaultProvider) Call ¶
func (d *DefaultProvider) Call(request motan.Request) (res motan.Response)
func (*DefaultProvider) Destroy ¶
func (d *DefaultProvider) Destroy()
func (*DefaultProvider) GetPath ¶
func (d *DefaultProvider) GetPath() string
func (*DefaultProvider) GetURL ¶
func (d *DefaultProvider) GetURL() *motan.URL
func (*DefaultProvider) Initialize ¶
func (d *DefaultProvider) Initialize()
func (*DefaultProvider) IsAvailable ¶
func (d *DefaultProvider) IsAvailable() bool
func (*DefaultProvider) SetService ¶
func (d *DefaultProvider) SetService(s interface{})
func (*DefaultProvider) SetURL ¶
func (d *DefaultProvider) SetURL(url *motan.URL)
type HTTPProvider ¶
type HTTPProvider struct {
// contains filtered or unexported fields
}
HTTPProvider struct
func (*HTTPProvider) Call ¶
func (h *HTTPProvider) Call(request motan.Request) motan.Response
Call for do a motan call through this provider
func (*HTTPProvider) GetMixVars ¶
func (h *HTTPProvider) GetMixVars() []string
GetMixVars return the HTTPProvider mixVars
func (*HTTPProvider) GetName ¶
func (h *HTTPProvider) GetName() string
GetName return this provider name
func (*HTTPProvider) GetPath ¶
func (h *HTTPProvider) GetPath() string
GetPath return current url path from the provider's url
func (*HTTPProvider) GetURL ¶
func (h *HTTPProvider) GetURL() *motan.URL
GetURL return the url that represent for this provider
func (*HTTPProvider) IsAvailable ¶
func (h *HTTPProvider) IsAvailable() bool
IsAvailable to check if this provider is sitll working well
func (*HTTPProvider) SetContext ¶
func (h *HTTPProvider) SetContext(context *motan.Context)
SetContext use to set globle config to HTTPProvider
func (*HTTPProvider) SetMixVars ¶
func (h *HTTPProvider) SetMixVars(mixVars []string)
SetMixVars to set HTTPProvider mixVars to this provider
func (*HTTPProvider) SetProxy ¶
func (h *HTTPProvider) SetProxy(proxy bool)
SetProxy for HTTPProvider
func (*HTTPProvider) SetSerialization ¶
func (h *HTTPProvider) SetSerialization(s motan.Serialization)
SetSerialization for set a motan.SetSerialization to HTTPProvider
func (*HTTPProvider) SetService ¶
func (h *HTTPProvider) SetService(s interface{})
SetService to set services to this provider that wich can handle
func (*HTTPProvider) SetURL ¶
func (h *HTTPProvider) SetURL(url *motan.URL)
SetURL to set a motan to represent for this provider
type MockProvider ¶
type MockProvider struct { URL *motan.URL MockResponse motan.Response // contains filtered or unexported fields }
func (*MockProvider) Destroy ¶
func (m *MockProvider) Destroy()
func (*MockProvider) GetName ¶
func (m *MockProvider) GetName() string
func (*MockProvider) GetPath ¶
func (m *MockProvider) GetPath() string
func (*MockProvider) GetURL ¶
func (m *MockProvider) GetURL() *motan.URL
func (*MockProvider) Initialize ¶
func (m *MockProvider) Initialize()
func (*MockProvider) IsAvailable ¶
func (m *MockProvider) IsAvailable() bool
func (*MockProvider) SetProxy ¶
func (m *MockProvider) SetProxy(proxy bool)
func (*MockProvider) SetSerialization ¶
func (m *MockProvider) SetSerialization(s motan.Serialization)
func (*MockProvider) SetService ¶
func (m *MockProvider) SetService(s interface{})
func (*MockProvider) SetURL ¶
func (m *MockProvider) SetURL(url *motan.URL)
Click to show internal directories.
Click to hide internal directories.