Documentation ¶
Index ¶
- Variables
- func TimeoutCoder(f func(interface{}) error, e interface{}, msg string) error
- type ConsulConfig
- type ConsulManager
- func (self *ConsulManager) AddRegistration(name string, iface interface{})
- func (self *ConsulManager) CallService(srv string, args interface{}, reply interface{}) error
- func (self *ConsulManager) Client(dsname ...string) (*ConsulManager, error)
- func (self *ConsulManager) GetKV(key string, consulx ...*consulapi.Client) ([]byte, error)
- func (self *ConsulManager) InitConfig(input ...ConsulConfig) (*ConsulManager, error)
- func (self *ConsulManager) ReadJsonConfig(node string, result interface{}) error
- func (self *ConsulManager) StartListenAndServe()
- type MonitorLog
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultHost = "consulx.com:8500"
)
Functions ¶
func TimeoutCoder ¶
Types ¶
type ConsulConfig ¶
type ConsulConfig struct { DsName string Node string Host string Domain string CheckPort int RpcPort int ListenProt int Protocol string Logger string Timeout string Interval string DestroyAfter string }
Consulx配置参数
type ConsulManager ¶
type ConsulManager struct { Host string Consulx *consulapi.Client Config *ConsulConfig }
func (*ConsulManager) AddRegistration ¶
func (self *ConsulManager) AddRegistration(name string, iface interface{})
中心注册接口服务
func (*ConsulManager) CallService ¶
func (self *ConsulManager) CallService(srv string, args interface{}, reply interface{}) error
获取RPC服务,并执行访问 args参数不可变,reply参数可变
func (*ConsulManager) Client ¶
func (self *ConsulManager) Client(dsname ...string) (*ConsulManager, error)
func (*ConsulManager) InitConfig ¶
func (self *ConsulManager) InitConfig(input ...ConsulConfig) (*ConsulManager, error)
func (*ConsulManager) ReadJsonConfig ¶
func (self *ConsulManager) ReadJsonConfig(node string, result interface{}) error
读取节点JSON配置
func (*ConsulManager) StartListenAndServe ¶
func (self *ConsulManager) StartListenAndServe()
开启并监听服务
Click to show internal directories.
Click to hide internal directories.