Documentation ¶
Overview ¶
Package registry is default registry implements.
Index ¶
- Constants
- func GetSanpshotConf() *motan.SnapshotConf
- func GetSubKey(url *motan.URL) string
- func IsAgent(url *motan.URL) bool
- func JSONString(v interface{}) string
- func RegistDefaultRegistry(extFactory motan.ExtentionFactory)
- func SetSanpshotConf(snapshotInterval time.Duration, snapshotDir string)
- func SliceByteToString(b []byte) string
- func StringToSliceByte(s string) []byte
- func ToAgentCommandPath(url *motan.URL) string
- func ToAgentNodePath(url *motan.URL) string
- func ToAgentNodeTypePath(url *motan.URL) string
- func ToAgentPath(url *motan.URL) string
- func ToCommandPath(url *motan.URL) string
- func ToGroupPath(url *motan.URL) string
- func ToNodePath(url *motan.URL, nodeType string) string
- func ToNodeTypePath(url *motan.URL, nodeType string) string
- func ToServicePath(url *motan.URL) string
- type ConsulRegistry
- func (v *ConsulRegistry) Available(serverURL *motan.URL)
- func (v *ConsulRegistry) Discover(url *motan.URL) []*motan.URL
- func (v *ConsulRegistry) GetName() string
- func (v *ConsulRegistry) GetRegisteredServices() []*motan.URL
- func (v *ConsulRegistry) GetURL() *motan.URL
- func (v *ConsulRegistry) Initialize()
- func (v *ConsulRegistry) Register(serverURL *motan.URL)
- func (v *ConsulRegistry) SetURL(url *motan.URL)
- func (v *ConsulRegistry) StartSnapshot(conf *motan.SnapshotConf)
- func (v *ConsulRegistry) Subscribe(url *motan.URL, listener motan.NotifyListener)
- func (v *ConsulRegistry) UnRegister(serverURL *motan.URL)
- func (v *ConsulRegistry) Unavailable(serverURL *motan.URL)
- func (v *ConsulRegistry) Unsubscribe(url *motan.URL, listener motan.NotifyListener)
- type DirectRegistry
- func (d *DirectRegistry) Available(serverURL *motan.URL)
- func (d *DirectRegistry) Discover(url *motan.URL) []*motan.URL
- func (d *DirectRegistry) GetName() string
- func (d *DirectRegistry) GetRegisteredServices() []*motan.URL
- func (d *DirectRegistry) GetURL() *motan.URL
- func (d *DirectRegistry) InitRegistry()
- func (d *DirectRegistry) Register(serverURL *motan.URL)
- func (d *DirectRegistry) SetURL(url *motan.URL)
- func (d *DirectRegistry) StartSnapshot(conf *motan.SnapshotConf)
- func (d *DirectRegistry) Subscribe(url *motan.URL, listener motan.NotifyListener)
- func (d *DirectRegistry) UnRegister(serverURL *motan.URL)
- func (d *DirectRegistry) Unavailable(serverURL *motan.URL)
- func (d *DirectRegistry) Unsubscribe(url *motan.URL, listener motan.NotifyListener)
- type ServiceNode
- type SnapShotNodeInfo
- type ZkRegistry
- func (z *ZkRegistry) Available(url *motan.URL)
- func (z *ZkRegistry) CreateNode(url *motan.URL, nodeType string) error
- func (z *ZkRegistry) CreatePersistent(path string, createParents bool)
- func (z *ZkRegistry) Discover(url *motan.URL) []*motan.URL
- func (z *ZkRegistry) DiscoverCommand(url *motan.URL) string
- func (z *ZkRegistry) GetName() string
- func (z *ZkRegistry) GetRegisteredServices() []*motan.URL
- func (z *ZkRegistry) GetURL() *motan.URL
- func (z *ZkRegistry) Initialize()
- func (z *ZkRegistry) Register(url *motan.URL)
- func (z *ZkRegistry) RemoveNode(url *motan.URL, nodeType string) error
- func (z *ZkRegistry) SetURL(url *motan.URL)
- func (z *ZkRegistry) StartSnapshot(conf *motan.SnapshotConf)
- func (z *ZkRegistry) Subscribe(url *motan.URL, listener motan.NotifyListener)
- func (z *ZkRegistry) SubscribeCommand(url *motan.URL, listener motan.CommandNotifyListener)
- func (z *ZkRegistry) UnRegister(url *motan.URL)
- func (z *ZkRegistry) UnSubscribeCommand(url *motan.URL, listener motan.CommandNotifyListener)
- func (z *ZkRegistry) Unavailable(url *motan.URL)
- func (z *ZkRegistry) Unsubscribe(url *motan.URL, listener motan.NotifyListener)
Constants ¶
View Source
const ( DefaultSnapshotInterval = 10 * time.Second DefaultHeartbeatInterval = 10 * 1000 //ms DefaultTimeout = 3 * 1000 //ms DefaultSnapshotDir = "./snapshot" )
View Source
const ( Direct = "direct" Consul = "consul" ZK = "zookeeper" )
ext name
View Source
const ( ZkRegistryNamespace = "/motan" ZkRegistryCommand = "/command" ZkRegistryNode = "/node" PathSeparator = "/" )
View Source
const ( ZkNodetypeServer = "server" ZkNodetypeClient = "client" ZkNodetypeAgent = "agent" )
Variables ¶
This section is empty.
Functions ¶
func GetSanpshotConf ¶
func GetSanpshotConf() *motan.SnapshotConf
func JSONString ¶
func JSONString(v interface{}) string
func RegistDefaultRegistry ¶
func RegistDefaultRegistry(extFactory motan.ExtentionFactory)
func SetSanpshotConf ¶
func SliceByteToString ¶
func StringToSliceByte ¶
func ToAgentCommandPath ¶
func ToAgentNodePath ¶
func ToAgentNodeTypePath ¶
func ToAgentPath ¶
func ToCommandPath ¶
func ToGroupPath ¶
func ToServicePath ¶
Types ¶
type ConsulRegistry ¶
type ConsulRegistry struct {
// contains filtered or unexported fields
}
ConsulRegistry TODO implement
func (*ConsulRegistry) Available ¶
func (v *ConsulRegistry) Available(serverURL *motan.URL)
func (*ConsulRegistry) GetName ¶
func (v *ConsulRegistry) GetName() string
func (*ConsulRegistry) GetRegisteredServices ¶
func (v *ConsulRegistry) GetRegisteredServices() []*motan.URL
func (*ConsulRegistry) GetURL ¶
func (v *ConsulRegistry) GetURL() *motan.URL
func (*ConsulRegistry) Initialize ¶
func (v *ConsulRegistry) Initialize()
func (*ConsulRegistry) Register ¶
func (v *ConsulRegistry) Register(serverURL *motan.URL)
func (*ConsulRegistry) SetURL ¶
func (v *ConsulRegistry) SetURL(url *motan.URL)
func (*ConsulRegistry) StartSnapshot ¶
func (v *ConsulRegistry) StartSnapshot(conf *motan.SnapshotConf)
func (*ConsulRegistry) Subscribe ¶
func (v *ConsulRegistry) Subscribe(url *motan.URL, listener motan.NotifyListener)
func (*ConsulRegistry) UnRegister ¶
func (v *ConsulRegistry) UnRegister(serverURL *motan.URL)
func (*ConsulRegistry) Unavailable ¶
func (v *ConsulRegistry) Unavailable(serverURL *motan.URL)
func (*ConsulRegistry) Unsubscribe ¶
func (v *ConsulRegistry) Unsubscribe(url *motan.URL, listener motan.NotifyListener)
type DirectRegistry ¶
type DirectRegistry struct {
// contains filtered or unexported fields
}
func (*DirectRegistry) Available ¶
func (d *DirectRegistry) Available(serverURL *motan.URL)
func (*DirectRegistry) GetName ¶
func (d *DirectRegistry) GetName() string
func (*DirectRegistry) GetRegisteredServices ¶
func (d *DirectRegistry) GetRegisteredServices() []*motan.URL
func (*DirectRegistry) GetURL ¶
func (d *DirectRegistry) GetURL() *motan.URL
func (*DirectRegistry) InitRegistry ¶
func (d *DirectRegistry) InitRegistry()
func (*DirectRegistry) Register ¶
func (d *DirectRegistry) Register(serverURL *motan.URL)
func (*DirectRegistry) SetURL ¶
func (d *DirectRegistry) SetURL(url *motan.URL)
func (*DirectRegistry) StartSnapshot ¶
func (d *DirectRegistry) StartSnapshot(conf *motan.SnapshotConf)
func (*DirectRegistry) Subscribe ¶
func (d *DirectRegistry) Subscribe(url *motan.URL, listener motan.NotifyListener)
func (*DirectRegistry) UnRegister ¶
func (d *DirectRegistry) UnRegister(serverURL *motan.URL)
func (*DirectRegistry) Unavailable ¶
func (d *DirectRegistry) Unavailable(serverURL *motan.URL)
func (*DirectRegistry) Unsubscribe ¶
func (d *DirectRegistry) Unsubscribe(url *motan.URL, listener motan.NotifyListener)
type ServiceNode ¶
type ServiceNode struct { Group string `json:"group"` Path string `json:"path"` Nodes []SnapShotNodeInfo `json:"nodes"` }
type SnapShotNodeInfo ¶
type ZkRegistry ¶
type ZkRegistry struct {
// contains filtered or unexported fields
}
func (*ZkRegistry) Available ¶
func (z *ZkRegistry) Available(url *motan.URL)
func (*ZkRegistry) CreateNode ¶
func (z *ZkRegistry) CreateNode(url *motan.URL, nodeType string) error
func (*ZkRegistry) CreatePersistent ¶
func (z *ZkRegistry) CreatePersistent(path string, createParents bool)
func (*ZkRegistry) DiscoverCommand ¶
func (z *ZkRegistry) DiscoverCommand(url *motan.URL) string
func (*ZkRegistry) GetName ¶
func (z *ZkRegistry) GetName() string
func (*ZkRegistry) GetRegisteredServices ¶
func (z *ZkRegistry) GetRegisteredServices() []*motan.URL
func (*ZkRegistry) GetURL ¶
func (z *ZkRegistry) GetURL() *motan.URL
func (*ZkRegistry) Initialize ¶
func (z *ZkRegistry) Initialize()
func (*ZkRegistry) Register ¶
func (z *ZkRegistry) Register(url *motan.URL)
func (*ZkRegistry) RemoveNode ¶
func (z *ZkRegistry) RemoveNode(url *motan.URL, nodeType string) error
func (*ZkRegistry) SetURL ¶
func (z *ZkRegistry) SetURL(url *motan.URL)
func (*ZkRegistry) StartSnapshot ¶
func (z *ZkRegistry) StartSnapshot(conf *motan.SnapshotConf)
func (*ZkRegistry) Subscribe ¶
func (z *ZkRegistry) Subscribe(url *motan.URL, listener motan.NotifyListener)
func (*ZkRegistry) SubscribeCommand ¶
func (z *ZkRegistry) SubscribeCommand(url *motan.URL, listener motan.CommandNotifyListener)
func (*ZkRegistry) UnRegister ¶
func (z *ZkRegistry) UnRegister(url *motan.URL)
func (*ZkRegistry) UnSubscribeCommand ¶
func (z *ZkRegistry) UnSubscribeCommand(url *motan.URL, listener motan.CommandNotifyListener)
func (*ZkRegistry) Unavailable ¶
func (z *ZkRegistry) Unavailable(url *motan.URL)
func (*ZkRegistry) Unsubscribe ¶
func (z *ZkRegistry) Unsubscribe(url *motan.URL, listener motan.NotifyListener)
Click to show internal directories.
Click to hide internal directories.