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.ExtensionFactory)
- 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 HTTPXProvider
- func (h *HTTPXProvider) Call(request motan.Request) motan.Response
- func (h *HTTPXProvider) Destroy()
- func (h *HTTPXProvider) GetMixVars() []string
- func (h *HTTPXProvider) GetName() string
- func (h *HTTPXProvider) GetPath() string
- func (h *HTTPXProvider) GetURL() *motan.URL
- func (h *HTTPXProvider) Initialize()
- func (h *HTTPXProvider) IsAvailable() bool
- func (h *HTTPXProvider) SetContext(context *motan.Context)
- func (h *HTTPXProvider) SetMixVars(mixVars []string)
- func (h *HTTPXProvider) SetProxy(proxy bool)
- func (h *HTTPXProvider) SetSerialization(s motan.Serialization)
- func (h *HTTPXProvider) SetService(s interface{})
- func (h *HTTPXProvider) 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)
- type MotanProvider
- func (m *MotanProvider) Call(request motan.Request) motan.Response
- func (m *MotanProvider) Destroy()
- func (m *MotanProvider) GetName() string
- func (m *MotanProvider) GetPath() string
- func (m *MotanProvider) GetURL() *motan.URL
- func (m *MotanProvider) Initialize()
- func (m *MotanProvider) IsAvailable() bool
- func (m *MotanProvider) SetContext(context *motan.Context)
- func (m *MotanProvider) SetProxy(proxy bool)
- func (m *MotanProvider) SetSerialization(s motan.Serialization)
- func (m *MotanProvider) SetService(s interface{})
- func (m *MotanProvider) SetURL(url *motan.URL)
Constants ¶
const ( CGIKeyPrefix = "CGI_" DefaultCGIHost = "127.0.0.1" DefaultCGIPort = 9000 HTTPMethodPOST = "POST" HTTPMethodGET = "GET" )
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" DefaultRequestTimeout = 1 * time.Second )
const ( ExtConfSection = "http-service" ClientName = "weibo-mesh-http" DefaultWriteTimeout = 1 * time.Second DefaultReadTimeout = 1 * time.Second DefaultMaxConnsPerHost = 1024 DefaultMaxIdleConnDuration = 30 * time.Second )
Default options for httpxProvider confs
const ( ProxyHostKey = "proxy.host" DefaultHost = "127.0.0.1" )
const ( CGI = "cgi" HTTP = "http" HTTPX = "httpx" MOTAN2 = "motan2" Mock = "mockProvider" Default = "default" )
ext name
Variables ¶
var NeededCGIEnv = []string{"REQUEST_METHOD", "SCRIPT_FILENAME", "DOCUMENT_ROOT"}
Functions ¶
func ParseFastCgiResponse ¶
func RegistDefaultProvider ¶
func RegistDefaultProvider(extFactory motan.ExtensionFactory)
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 global 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 HTTPXProvider ¶
type HTTPXProvider struct {
// contains filtered or unexported fields
}
HTTPXProvider struct
func (*HTTPXProvider) Call ¶
func (h *HTTPXProvider) Call(request motan.Request) motan.Response
Call for do a motan call through this provider
func (*HTTPXProvider) GetMixVars ¶
func (h *HTTPXProvider) GetMixVars() []string
GetMixVars return the HTTPXProvider mixVars
func (*HTTPXProvider) GetName ¶
func (h *HTTPXProvider) GetName() string
GetName return this provider name
func (*HTTPXProvider) GetPath ¶
func (h *HTTPXProvider) GetPath() string
GetPath return current url path from the provider's url
func (*HTTPXProvider) GetURL ¶
func (h *HTTPXProvider) GetURL() *motan.URL
GetURL return the url that represent for this provider
func (*HTTPXProvider) IsAvailable ¶
func (h *HTTPXProvider) IsAvailable() bool
IsAvailable to check if this provider is sitll working well
func (*HTTPXProvider) SetContext ¶
func (h *HTTPXProvider) SetContext(context *motan.Context)
SetContext use to set globle config to HTTPXProvider
func (*HTTPXProvider) SetMixVars ¶
func (h *HTTPXProvider) SetMixVars(mixVars []string)
SetMixVars to set HTTPXProvider mixVars to this provider
func (*HTTPXProvider) SetProxy ¶
func (h *HTTPXProvider) SetProxy(proxy bool)
SetProxy for HTTPXProvider
func (*HTTPXProvider) SetSerialization ¶
func (h *HTTPXProvider) SetSerialization(s motan.Serialization)
SetSerialization for set a motan.SetSerialization to HTTPXProvider
func (*HTTPXProvider) SetService ¶
func (h *HTTPXProvider) SetService(s interface{})
SetService to set services to this provider that wich can handle
func (*HTTPXProvider) SetURL ¶
func (h *HTTPXProvider) 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)
type MotanProvider ¶
type MotanProvider struct {
// contains filtered or unexported fields
}
func (*MotanProvider) Destroy ¶
func (m *MotanProvider) Destroy()
func (*MotanProvider) GetName ¶
func (m *MotanProvider) GetName() string
func (*MotanProvider) GetPath ¶
func (m *MotanProvider) GetPath() string
func (*MotanProvider) GetURL ¶
func (m *MotanProvider) GetURL() *motan.URL
func (*MotanProvider) Initialize ¶
func (m *MotanProvider) Initialize()
func (*MotanProvider) IsAvailable ¶
func (m *MotanProvider) IsAvailable() bool
func (*MotanProvider) SetContext ¶
func (m *MotanProvider) SetContext(context *motan.Context)
func (*MotanProvider) SetProxy ¶
func (m *MotanProvider) SetProxy(proxy bool)
func (*MotanProvider) SetSerialization ¶
func (m *MotanProvider) SetSerialization(s motan.Serialization)
func (*MotanProvider) SetService ¶
func (m *MotanProvider) SetService(s interface{})
func (*MotanProvider) SetURL ¶
func (m *MotanProvider) SetURL(url *motan.URL)