Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultPort = 8910
View Source
const ESConfigPath = "esconfig"
View Source
const ESKeyFileExt = ".eskey"
View Source
const ESVersion = 69
View Source
const ETCDBasePath = "/es_rpc"
Variables ¶
View Source
var DefaultConfigs = []string{"es.yml", "es.json"}
Functions ¶
func SearchFile ¶ added in v1.1.0
Types ¶
type ESConfig ¶
type ESConfig struct {
Port int `default:"8910"` //服务端口,默认端口8910
Name string //系统中的nodename用于区分不同服务
Key string //链接密钥,用于链接到整个系统中
Etcd string //发现服务地址
Endpoint string //访问端点,如果配置,服务启动时会使用访问端点向etcd进行注册,其他服务会通过此访问端点来访问此服务
}
ESConfig 配置文件映射结构
type MethodInfo ¶
type MethodInfo struct {
MethodName string //方法名
ParamsType []string //每个参数类型
ReturnsType []string // 方法返回参数的类型
}
MethodInfo 方法信息
type NodeInfo ¶
type NodeInfo struct {
NodeName string //节点名称
ESVersion int // 存储es的版本号
Services map[string]*ServiceInfo // 当前节点包含的服务
}
NodeInfo 节点信息
type Request ¶
type Request struct {
NodeName string // 节点名称
Path string //服务包路径
Method string //服务名
Parameters [][]byte //调用参数
}
Request 调用服务的时候发出去的数据
func (*Request) AddParameter ¶
func (*Request) SetParameters ¶
type ServiceInfo ¶
type ServiceInfo struct {
Path string //服务对象(结构)路径
Methods map[string]*MethodInfo // 服务提供的方法
}
ServiceInfo 服务信息
Click to show internal directories.
Click to hide internal directories.