Documentation ¶
Index ¶
- Variables
- func RegisterDiscoveryServer(s *grpc.Server, srv DiscoveryServer)
- func RegisterSyncServer(s *grpc.Server, srv SyncServer)
- type ConfigEvent
- func (*ConfigEvent) Descriptor() ([]byte, []int)
- func (m *ConfigEvent) GetData() string
- func (m *ConfigEvent) GetEventType() ConfigEventType
- func (*ConfigEvent) ProtoMessage()
- func (m *ConfigEvent) Reset()
- func (m *ConfigEvent) String() string
- func (m *ConfigEvent) Validate() error
- func (m *ConfigEvent) XXX_DiscardUnknown()
- func (m *ConfigEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ConfigEvent) XXX_Merge(src proto.Message)
- func (m *ConfigEvent) XXX_Size() int
- func (m *ConfigEvent) XXX_Unmarshal(b []byte) error
- type ConfigEventType
- type ConfigEventValidationError
- func (e ConfigEventValidationError) Cause() error
- func (e ConfigEventValidationError) Error() string
- func (e ConfigEventValidationError) ErrorName() string
- func (e ConfigEventValidationError) Field() string
- func (e ConfigEventValidationError) Key() bool
- func (e ConfigEventValidationError) Reason() string
- type DeregisterReq
- func (*DeregisterReq) Descriptor() ([]byte, []int)
- func (m *DeregisterReq) GetInstance() *Instance
- func (*DeregisterReq) ProtoMessage()
- func (m *DeregisterReq) Reset()
- func (m *DeregisterReq) String() string
- func (m *DeregisterReq) Validate() error
- func (m *DeregisterReq) XXX_DiscardUnknown()
- func (m *DeregisterReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DeregisterReq) XXX_Merge(src proto.Message)
- func (m *DeregisterReq) XXX_Size() int
- func (m *DeregisterReq) XXX_Unmarshal(b []byte) error
- type DeregisterReqValidationError
- func (e DeregisterReqValidationError) Cause() error
- func (e DeregisterReqValidationError) Error() string
- func (e DeregisterReqValidationError) ErrorName() string
- func (e DeregisterReqValidationError) Field() string
- func (e DeregisterReqValidationError) Key() bool
- func (e DeregisterReqValidationError) Reason() string
- type DiscoveryClient
- type DiscoveryEventType
- type DiscoveryServer
- type Discovery_PollsClient
- type Discovery_PollsServer
- type Instance
- func (*Instance) Descriptor() ([]byte, []int)
- func (m *Instance) GetAddrs() map[string]string
- func (m *Instance) GetEnv() string
- func (m *Instance) GetHostname() string
- func (m *Instance) GetId() string
- func (m *Instance) GetMetadata() map[string]string
- func (m *Instance) GetRegTime() int64
- func (m *Instance) GetServiceName() string
- func (m *Instance) GetUpdateTime() int64
- func (m *Instance) GetZone() string
- func (*Instance) ProtoMessage()
- func (m *Instance) Reset()
- func (m *Instance) String() string
- func (m *Instance) Validate() error
- func (m *Instance) XXX_DiscardUnknown()
- func (m *Instance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Instance) XXX_Merge(src proto.Message)
- func (m *Instance) XXX_Size() int
- func (m *Instance) XXX_Unmarshal(b []byte) error
- type InstanceValidationError
- type KeepAliveReq
- func (*KeepAliveReq) Descriptor() ([]byte, []int)
- func (m *KeepAliveReq) GetInstance() *Instance
- func (m *KeepAliveReq) GetLeaseSecond() int64
- func (*KeepAliveReq) ProtoMessage()
- func (m *KeepAliveReq) Reset()
- func (m *KeepAliveReq) String() string
- func (m *KeepAliveReq) Validate() error
- func (m *KeepAliveReq) XXX_DiscardUnknown()
- func (m *KeepAliveReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *KeepAliveReq) XXX_Merge(src proto.Message)
- func (m *KeepAliveReq) XXX_Size() int
- func (m *KeepAliveReq) XXX_Unmarshal(b []byte) error
- type KeepAliveReqValidationError
- func (e KeepAliveReqValidationError) Cause() error
- func (e KeepAliveReqValidationError) Error() string
- func (e KeepAliveReqValidationError) ErrorName() string
- func (e KeepAliveReqValidationError) Field() string
- func (e KeepAliveReqValidationError) Key() bool
- func (e KeepAliveReqValidationError) Reason() string
- type PollsReq
- func (*PollsReq) Descriptor() ([]byte, []int)
- func (m *PollsReq) GetEnv() string
- func (m *PollsReq) GetPollServices() map[string]int64
- func (m *PollsReq) GetSubscriber() string
- func (*PollsReq) ProtoMessage()
- func (m *PollsReq) Reset()
- func (m *PollsReq) String() string
- func (m *PollsReq) Validate() error
- func (m *PollsReq) XXX_DiscardUnknown()
- func (m *PollsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PollsReq) XXX_Merge(src proto.Message)
- func (m *PollsReq) XXX_Size() int
- func (m *PollsReq) XXX_Unmarshal(b []byte) error
- type PollsReqValidationError
- type PollsResp
- func (*PollsResp) Descriptor() ([]byte, []int)
- func (m *PollsResp) GetEventType() DiscoveryEventType
- func (m *PollsResp) GetServices() map[string]*Service
- func (*PollsResp) ProtoMessage()
- func (m *PollsResp) Reset()
- func (m *PollsResp) String() string
- func (m *PollsResp) Validate() error
- func (m *PollsResp) XXX_DiscardUnknown()
- func (m *PollsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PollsResp) XXX_Merge(src proto.Message)
- func (m *PollsResp) XXX_Size() int
- func (m *PollsResp) XXX_Unmarshal(b []byte) error
- type PollsRespValidationError
- type RegisterReq
- func (*RegisterReq) Descriptor() ([]byte, []int)
- func (m *RegisterReq) GetInstance() *Instance
- func (m *RegisterReq) GetLeaseSecond() int64
- func (*RegisterReq) ProtoMessage()
- func (m *RegisterReq) Reset()
- func (m *RegisterReq) String() string
- func (m *RegisterReq) Validate() error
- func (m *RegisterReq) XXX_DiscardUnknown()
- func (m *RegisterReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RegisterReq) XXX_Merge(src proto.Message)
- func (m *RegisterReq) XXX_Size() int
- func (m *RegisterReq) XXX_Unmarshal(b []byte) error
- type RegisterReqValidationError
- func (e RegisterReqValidationError) Cause() error
- func (e RegisterReqValidationError) Error() string
- func (e RegisterReqValidationError) ErrorName() string
- func (e RegisterReqValidationError) Field() string
- func (e RegisterReqValidationError) Key() bool
- func (e RegisterReqValidationError) Reason() string
- type Service
- func (*Service) Descriptor() ([]byte, []int)
- func (m *Service) GetInstances() map[string]*ZoneGroup
- func (m *Service) GetMetadata() map[string]string
- func (m *Service) GetServiceName() string
- func (m *Service) GetUpdateTime() int64
- func (m *Service) GetVersion() int64
- func (*Service) ProtoMessage()
- func (m *Service) Reset()
- func (m *Service) String() string
- func (m *Service) Validate() error
- func (m *Service) XXX_DiscardUnknown()
- func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Service) XXX_Merge(src proto.Message)
- func (m *Service) XXX_Size() int
- func (m *Service) XXX_Unmarshal(b []byte) error
- type ServiceValidationError
- type SyncClient
- type SyncServer
- type Sync_SyncClient
- type Sync_SyncServer
- type UnimplementedDiscoveryServer
- func (*UnimplementedDiscoveryServer) Deregister(ctx context.Context, req *DeregisterReq) (*empty.Empty, error)
- func (*UnimplementedDiscoveryServer) KeepAlive(ctx context.Context, req *KeepAliveReq) (*empty.Empty, error)
- func (*UnimplementedDiscoveryServer) Polls(srv Discovery_PollsServer) error
- func (*UnimplementedDiscoveryServer) Register(ctx context.Context, req *RegisterReq) (*empty.Empty, error)
- type UnimplementedSyncServer
- type ZoneGroup
- func (*ZoneGroup) Descriptor() ([]byte, []int)
- func (m *ZoneGroup) GetZoneGroup() map[string]*Instance
- func (*ZoneGroup) ProtoMessage()
- func (m *ZoneGroup) Reset()
- func (m *ZoneGroup) String() string
- func (m *ZoneGroup) Validate() error
- func (m *ZoneGroup) XXX_DiscardUnknown()
- func (m *ZoneGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ZoneGroup) XXX_Merge(src proto.Message)
- func (m *ZoneGroup) XXX_Size() int
- func (m *ZoneGroup) XXX_Unmarshal(b []byte) error
- type ZoneGroupValidationError
Constants ¶
This section is empty.
Variables ¶
var ConfigEventType_name = map[int32]string{
0: "_CONFIG_EVENT_TYPE_",
-1: "CONFIG_EVENT_NONE",
1: "CONFIG_EVENT_SYNC",
2: "CONFIG_EVENT_NODE_CONF_CHANGED",
3: "CONFIG_EVENT_NODE_REGISTER",
4: "CONFIG_EVENT_NODE_STATUS",
5: "CONFIG_EVENT_NODE_PROC",
6: "CONFIG_EVENT_NODE_EXIT",
7: "CONFIG_EVENT_CMD_START",
8: "CONFIG_EVENT_CMD_STOP",
9: "CONFIG_EVENT_CMD_RESTART",
10: "CONFIG_EVENT_OPERATE",
11: "CONFIG_EVENT_OPERATE_BATCH",
12: "CONFIG_OPERATE_ROLLBACK",
}
var ConfigEventType_value = map[string]int32{
"_CONFIG_EVENT_TYPE_": 0,
"CONFIG_EVENT_NONE": -1,
"CONFIG_EVENT_SYNC": 1,
"CONFIG_EVENT_NODE_CONF_CHANGED": 2,
"CONFIG_EVENT_NODE_REGISTER": 3,
"CONFIG_EVENT_NODE_STATUS": 4,
"CONFIG_EVENT_NODE_PROC": 5,
"CONFIG_EVENT_NODE_EXIT": 6,
"CONFIG_EVENT_CMD_START": 7,
"CONFIG_EVENT_CMD_STOP": 8,
"CONFIG_EVENT_CMD_RESTART": 9,
"CONFIG_EVENT_OPERATE": 10,
"CONFIG_EVENT_OPERATE_BATCH": 11,
"CONFIG_OPERATE_ROLLBACK": 12,
}
var DiscoveryEventType_name = map[int32]string{
0: "_DISCOVERY_EVENT_TYPE_",
1: "DISCOVERY_EVENT_NONE",
2: "DISCOVERY_EVENT_UPDATE",
}
var DiscoveryEventType_value = map[string]int32{
"_DISCOVERY_EVENT_TYPE_": 0,
"DISCOVERY_EVENT_NONE": 1,
"DISCOVERY_EVENT_UPDATE": 2,
}
Functions ¶
func RegisterDiscoveryServer ¶
func RegisterDiscoveryServer(s *grpc.Server, srv DiscoveryServer)
func RegisterSyncServer ¶
func RegisterSyncServer(s *grpc.Server, srv SyncServer)
Types ¶
type ConfigEvent ¶
type ConfigEvent struct { //请求的事件类型 EventType ConfigEventType `protobuf:"varint,1,opt,name=event_type,json=eventType,proto3,enum=keeper.ConfigEventType" json:"event_type,omitempty"` //数据信息,json格式 Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
配置变动的接口体
func (*ConfigEvent) Descriptor ¶
func (*ConfigEvent) Descriptor() ([]byte, []int)
func (*ConfigEvent) GetData ¶
func (m *ConfigEvent) GetData() string
func (*ConfigEvent) GetEventType ¶
func (m *ConfigEvent) GetEventType() ConfigEventType
func (*ConfigEvent) ProtoMessage ¶
func (*ConfigEvent) ProtoMessage()
func (*ConfigEvent) Reset ¶
func (m *ConfigEvent) Reset()
func (*ConfigEvent) String ¶
func (m *ConfigEvent) String() string
func (*ConfigEvent) Validate ¶
func (m *ConfigEvent) Validate() error
Validate checks the field values on ConfigEvent with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*ConfigEvent) XXX_DiscardUnknown ¶
func (m *ConfigEvent) XXX_DiscardUnknown()
func (*ConfigEvent) XXX_Marshal ¶
func (m *ConfigEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ConfigEvent) XXX_Merge ¶
func (m *ConfigEvent) XXX_Merge(src proto.Message)
func (*ConfigEvent) XXX_Size ¶
func (m *ConfigEvent) XXX_Size() int
func (*ConfigEvent) XXX_Unmarshal ¶
func (m *ConfigEvent) XXX_Unmarshal(b []byte) error
type ConfigEventType ¶
type ConfigEventType int32
配置的事件类型
const ( // type ConfigEventType__CONFIG_EVENT_TYPE_ ConfigEventType = 0 // 配置无改变事件,为了兼容以前的事件类型,none设置为负数 ConfigEventType_CONFIG_EVENT_NONE ConfigEventType = -1 // 配置同步事件 ConfigEventType_CONFIG_EVENT_SYNC ConfigEventType = 1 // 节点配置更改 ConfigEventType_CONFIG_EVENT_NODE_CONF_CHANGED ConfigEventType = 2 // 节点注册 ConfigEventType_CONFIG_EVENT_NODE_REGISTER ConfigEventType = 3 // 节点状态事件 ConfigEventType_CONFIG_EVENT_NODE_STATUS ConfigEventType = 4 // 节点运行资源事件 ConfigEventType_CONFIG_EVENT_NODE_PROC ConfigEventType = 5 // 节点退出事件 ConfigEventType_CONFIG_EVENT_NODE_EXIT ConfigEventType = 6 // 命令启动事件 ConfigEventType_CONFIG_EVENT_CMD_START ConfigEventType = 7 // 命令停止事件 ConfigEventType_CONFIG_EVENT_CMD_STOP ConfigEventType = 8 // 命令重启事件 ConfigEventType_CONFIG_EVENT_CMD_RESTART ConfigEventType = 9 // 配置操作事件 ConfigEventType_CONFIG_EVENT_OPERATE ConfigEventType = 10 // 配置批量操作事件 ConfigEventType_CONFIG_EVENT_OPERATE_BATCH ConfigEventType = 11 // 配置回滚事件 ConfigEventType_CONFIG_OPERATE_ROLLBACK ConfigEventType = 12 )
func (ConfigEventType) EnumDescriptor ¶
func (ConfigEventType) EnumDescriptor() ([]byte, []int)
func (ConfigEventType) String ¶
func (x ConfigEventType) String() string
type ConfigEventValidationError ¶
type ConfigEventValidationError struct {
// contains filtered or unexported fields
}
ConfigEventValidationError is the validation error returned by ConfigEvent.Validate if the designated constraints aren't met.
func (ConfigEventValidationError) Cause ¶
func (e ConfigEventValidationError) Cause() error
Cause function returns cause value.
func (ConfigEventValidationError) Error ¶
func (e ConfigEventValidationError) Error() string
Error satisfies the builtin error interface
func (ConfigEventValidationError) ErrorName ¶
func (e ConfigEventValidationError) ErrorName() string
ErrorName returns error name.
func (ConfigEventValidationError) Field ¶
func (e ConfigEventValidationError) Field() string
Field function returns field value.
func (ConfigEventValidationError) Key ¶
func (e ConfigEventValidationError) Key() bool
Key function returns key value.
func (ConfigEventValidationError) Reason ¶
func (e ConfigEventValidationError) Reason() string
Reason function returns reason value.
type DeregisterReq ¶
type DeregisterReq struct { //实例信息 Instance *Instance `protobuf:"bytes,1,opt,name=instance,proto3" json:"instance,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
服务解除注册请求体
func (*DeregisterReq) Descriptor ¶
func (*DeregisterReq) Descriptor() ([]byte, []int)
func (*DeregisterReq) GetInstance ¶
func (m *DeregisterReq) GetInstance() *Instance
func (*DeregisterReq) ProtoMessage ¶
func (*DeregisterReq) ProtoMessage()
func (*DeregisterReq) Reset ¶
func (m *DeregisterReq) Reset()
func (*DeregisterReq) String ¶
func (m *DeregisterReq) String() string
func (*DeregisterReq) Validate ¶
func (m *DeregisterReq) Validate() error
Validate checks the field values on DeregisterReq with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*DeregisterReq) XXX_DiscardUnknown ¶
func (m *DeregisterReq) XXX_DiscardUnknown()
func (*DeregisterReq) XXX_Marshal ¶
func (m *DeregisterReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DeregisterReq) XXX_Merge ¶
func (m *DeregisterReq) XXX_Merge(src proto.Message)
func (*DeregisterReq) XXX_Size ¶
func (m *DeregisterReq) XXX_Size() int
func (*DeregisterReq) XXX_Unmarshal ¶
func (m *DeregisterReq) XXX_Unmarshal(b []byte) error
type DeregisterReqValidationError ¶
type DeregisterReqValidationError struct {
// contains filtered or unexported fields
}
DeregisterReqValidationError is the validation error returned by DeregisterReq.Validate if the designated constraints aren't met.
func (DeregisterReqValidationError) Cause ¶
func (e DeregisterReqValidationError) Cause() error
Cause function returns cause value.
func (DeregisterReqValidationError) Error ¶
func (e DeregisterReqValidationError) Error() string
Error satisfies the builtin error interface
func (DeregisterReqValidationError) ErrorName ¶
func (e DeregisterReqValidationError) ErrorName() string
ErrorName returns error name.
func (DeregisterReqValidationError) Field ¶
func (e DeregisterReqValidationError) Field() string
Field function returns field value.
func (DeregisterReqValidationError) Key ¶
func (e DeregisterReqValidationError) Key() bool
Key function returns key value.
func (DeregisterReqValidationError) Reason ¶
func (e DeregisterReqValidationError) Reason() string
Reason function returns reason value.
type DiscoveryClient ¶
type DiscoveryClient interface { //服务注册接口,服务就绪后调用 Register(ctx context.Context, in *RegisterReq, opts ...grpc.CallOption) (*empty.Empty, error) //服务心跳接口 KeepAlive(ctx context.Context, in *KeepAliveReq, opts ...grpc.CallOption) (*empty.Empty, error) //服务解除注册接口,服务下线时调用 Deregister(ctx context.Context, in *DeregisterReq, opts ...grpc.CallOption) (*empty.Empty, error) //批量获取服务的节点信息,如果没有相关数据更新,则阻塞一段时间 Polls(ctx context.Context, opts ...grpc.CallOption) (Discovery_PollsClient, error) }
DiscoveryClient is the client API for Discovery service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewDiscoveryClient ¶
func NewDiscoveryClient(cc *grpc.ClientConn) DiscoveryClient
type DiscoveryEventType ¶
type DiscoveryEventType int32
服务发现列表事件
const ( // type DiscoveryEventType__DISCOVERY_EVENT_TYPE_ DiscoveryEventType = 0 //服务列表未更新 DiscoveryEventType_DISCOVERY_EVENT_NONE DiscoveryEventType = 1 //服务列表更新 DiscoveryEventType_DISCOVERY_EVENT_UPDATE DiscoveryEventType = 2 )
func (DiscoveryEventType) EnumDescriptor ¶
func (DiscoveryEventType) EnumDescriptor() ([]byte, []int)
func (DiscoveryEventType) String ¶
func (x DiscoveryEventType) String() string
type DiscoveryServer ¶
type DiscoveryServer interface { //服务注册接口,服务就绪后调用 Register(context.Context, *RegisterReq) (*empty.Empty, error) //服务心跳接口 KeepAlive(context.Context, *KeepAliveReq) (*empty.Empty, error) //服务解除注册接口,服务下线时调用 Deregister(context.Context, *DeregisterReq) (*empty.Empty, error) //批量获取服务的节点信息,如果没有相关数据更新,则阻塞一段时间 Polls(Discovery_PollsServer) error }
DiscoveryServer is the server API for Discovery service.
type Discovery_PollsClient ¶
type Discovery_PollsServer ¶
type Instance ¶
type Instance struct { //实例id Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` //服务名称 ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` //机房,bjcc/bjyt/bjdt Zone string `protobuf:"bytes,3,opt,name=zone,proto3" json:"zone,omitempty"` //环境,prod(线上)/pre(预发布)/test(测试)/dev(开发) Env string `protobuf:"bytes,4,opt,name=env,proto3" json:"env,omitempty"` //机器地址 Hostname string `protobuf:"bytes,5,opt,name=hostname,proto3" json:"hostname,omitempty"` //地址 scheme -> address 例如: http -> 127.0.0.1:8080、grpc -> 127.0.0.1:8081 Addrs map[string]string `` /* 151-byte string literal not displayed */ //元组数据,例如weight权重信息 Metadata map[string]string `` /* 157-byte string literal not displayed */ //注册时间 RegTime int64 `protobuf:"varint,8,opt,name=reg_time,json=regTime,proto3" json:"reg_time,omitempty"` //更新时间 UpdateTime int64 `protobuf:"varint,9,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
实例信息,可参考Instance结构体
func (*Instance) Descriptor ¶
func (*Instance) GetHostname ¶
func (*Instance) GetMetadata ¶
func (*Instance) GetRegTime ¶
func (*Instance) GetServiceName ¶
func (*Instance) GetUpdateTime ¶
func (*Instance) ProtoMessage ¶
func (*Instance) ProtoMessage()
func (*Instance) Validate ¶
Validate checks the field values on Instance with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*Instance) XXX_DiscardUnknown ¶
func (m *Instance) XXX_DiscardUnknown()
func (*Instance) XXX_Marshal ¶
func (*Instance) XXX_Unmarshal ¶
type InstanceValidationError ¶
type InstanceValidationError struct {
// contains filtered or unexported fields
}
InstanceValidationError is the validation error returned by Instance.Validate if the designated constraints aren't met.
func (InstanceValidationError) Cause ¶
func (e InstanceValidationError) Cause() error
Cause function returns cause value.
func (InstanceValidationError) Error ¶
func (e InstanceValidationError) Error() string
Error satisfies the builtin error interface
func (InstanceValidationError) ErrorName ¶
func (e InstanceValidationError) ErrorName() string
ErrorName returns error name.
func (InstanceValidationError) Field ¶
func (e InstanceValidationError) Field() string
Field function returns field value.
func (InstanceValidationError) Key ¶
func (e InstanceValidationError) Key() bool
Key function returns key value.
func (InstanceValidationError) Reason ¶
func (e InstanceValidationError) Reason() string
Reason function returns reason value.
type KeepAliveReq ¶
type KeepAliveReq struct { //实例信息 Instance *Instance `protobuf:"bytes,1,opt,name=instance,proto3" json:"instance,omitempty"` //实例续约时间,单位秒 LeaseSecond int64 `protobuf:"varint,2,opt,name=lease_second,json=leaseSecond,proto3" json:"lease_second,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
服务周期续约请求体
func (*KeepAliveReq) Descriptor ¶
func (*KeepAliveReq) Descriptor() ([]byte, []int)
func (*KeepAliveReq) GetInstance ¶
func (m *KeepAliveReq) GetInstance() *Instance
func (*KeepAliveReq) GetLeaseSecond ¶
func (m *KeepAliveReq) GetLeaseSecond() int64
func (*KeepAliveReq) ProtoMessage ¶
func (*KeepAliveReq) ProtoMessage()
func (*KeepAliveReq) Reset ¶
func (m *KeepAliveReq) Reset()
func (*KeepAliveReq) String ¶
func (m *KeepAliveReq) String() string
func (*KeepAliveReq) Validate ¶
func (m *KeepAliveReq) Validate() error
Validate checks the field values on KeepAliveReq with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*KeepAliveReq) XXX_DiscardUnknown ¶
func (m *KeepAliveReq) XXX_DiscardUnknown()
func (*KeepAliveReq) XXX_Marshal ¶
func (m *KeepAliveReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*KeepAliveReq) XXX_Merge ¶
func (m *KeepAliveReq) XXX_Merge(src proto.Message)
func (*KeepAliveReq) XXX_Size ¶
func (m *KeepAliveReq) XXX_Size() int
func (*KeepAliveReq) XXX_Unmarshal ¶
func (m *KeepAliveReq) XXX_Unmarshal(b []byte) error
type KeepAliveReqValidationError ¶
type KeepAliveReqValidationError struct {
// contains filtered or unexported fields
}
KeepAliveReqValidationError is the validation error returned by KeepAliveReq.Validate if the designated constraints aren't met.
func (KeepAliveReqValidationError) Cause ¶
func (e KeepAliveReqValidationError) Cause() error
Cause function returns cause value.
func (KeepAliveReqValidationError) Error ¶
func (e KeepAliveReqValidationError) Error() string
Error satisfies the builtin error interface
func (KeepAliveReqValidationError) ErrorName ¶
func (e KeepAliveReqValidationError) ErrorName() string
ErrorName returns error name.
func (KeepAliveReqValidationError) Field ¶
func (e KeepAliveReqValidationError) Field() string
Field function returns field value.
func (KeepAliveReqValidationError) Key ¶
func (e KeepAliveReqValidationError) Key() bool
Key function returns key value.
func (KeepAliveReqValidationError) Reason ¶
func (e KeepAliveReqValidationError) Reason() string
Reason function returns reason value.
type PollsReq ¶
type PollsReq struct { //服务信息 service_name -> version PollServices map[string]int64 `` /* 186-byte string literal not displayed */ //环境 Env string `protobuf:"bytes,2,opt,name=env,proto3" json:"env,omitempty"` //订阅者 Subscriber string `protobuf:"bytes,3,opt,name=subscriber,proto3" json:"subscriber,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
批量获取服务节点的请求体
func (*PollsReq) Descriptor ¶
func (*PollsReq) GetPollServices ¶
func (*PollsReq) GetSubscriber ¶
func (*PollsReq) ProtoMessage ¶
func (*PollsReq) ProtoMessage()
func (*PollsReq) Validate ¶
Validate checks the field values on PollsReq with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*PollsReq) XXX_DiscardUnknown ¶
func (m *PollsReq) XXX_DiscardUnknown()
func (*PollsReq) XXX_Marshal ¶
func (*PollsReq) XXX_Unmarshal ¶
type PollsReqValidationError ¶
type PollsReqValidationError struct {
// contains filtered or unexported fields
}
PollsReqValidationError is the validation error returned by PollsReq.Validate if the designated constraints aren't met.
func (PollsReqValidationError) Cause ¶
func (e PollsReqValidationError) Cause() error
Cause function returns cause value.
func (PollsReqValidationError) Error ¶
func (e PollsReqValidationError) Error() string
Error satisfies the builtin error interface
func (PollsReqValidationError) ErrorName ¶
func (e PollsReqValidationError) ErrorName() string
ErrorName returns error name.
func (PollsReqValidationError) Field ¶
func (e PollsReqValidationError) Field() string
Field function returns field value.
func (PollsReqValidationError) Key ¶
func (e PollsReqValidationError) Key() bool
Key function returns key value.
func (PollsReqValidationError) Reason ¶
func (e PollsReqValidationError) Reason() string
Reason function returns reason value.
type PollsResp ¶
type PollsResp struct { //服务发现事件类型 EventType DiscoveryEventType `protobuf:"varint,1,opt,name=event_type,json=eventType,proto3,enum=keeper.DiscoveryEventType" json:"event_type,omitempty"` //服务信息,service_name -> service Services map[string]*Service `` /* 157-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
批量获取服务节点的返回体,方便后续扩展字段,单独声明一个结构体
func (*PollsResp) Descriptor ¶
func (*PollsResp) GetEventType ¶
func (m *PollsResp) GetEventType() DiscoveryEventType
func (*PollsResp) GetServices ¶
func (*PollsResp) ProtoMessage ¶
func (*PollsResp) ProtoMessage()
func (*PollsResp) Validate ¶
Validate checks the field values on PollsResp with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*PollsResp) XXX_DiscardUnknown ¶
func (m *PollsResp) XXX_DiscardUnknown()
func (*PollsResp) XXX_Marshal ¶
func (*PollsResp) XXX_Unmarshal ¶
type PollsRespValidationError ¶
type PollsRespValidationError struct {
// contains filtered or unexported fields
}
PollsRespValidationError is the validation error returned by PollsResp.Validate if the designated constraints aren't met.
func (PollsRespValidationError) Cause ¶
func (e PollsRespValidationError) Cause() error
Cause function returns cause value.
func (PollsRespValidationError) Error ¶
func (e PollsRespValidationError) Error() string
Error satisfies the builtin error interface
func (PollsRespValidationError) ErrorName ¶
func (e PollsRespValidationError) ErrorName() string
ErrorName returns error name.
func (PollsRespValidationError) Field ¶
func (e PollsRespValidationError) Field() string
Field function returns field value.
func (PollsRespValidationError) Key ¶
func (e PollsRespValidationError) Key() bool
Key function returns key value.
func (PollsRespValidationError) Reason ¶
func (e PollsRespValidationError) Reason() string
Reason function returns reason value.
type RegisterReq ¶
type RegisterReq struct { //实例信息 Instance *Instance `protobuf:"bytes,1,opt,name=instance,proto3" json:"instance,omitempty"` //实例续约时间,单位秒 LeaseSecond int64 `protobuf:"varint,2,opt,name=lease_second,json=leaseSecond,proto3" json:"lease_second,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
服务注册请求体
func (*RegisterReq) Descriptor ¶
func (*RegisterReq) Descriptor() ([]byte, []int)
func (*RegisterReq) GetInstance ¶
func (m *RegisterReq) GetInstance() *Instance
func (*RegisterReq) GetLeaseSecond ¶
func (m *RegisterReq) GetLeaseSecond() int64
func (*RegisterReq) ProtoMessage ¶
func (*RegisterReq) ProtoMessage()
func (*RegisterReq) Reset ¶
func (m *RegisterReq) Reset()
func (*RegisterReq) String ¶
func (m *RegisterReq) String() string
func (*RegisterReq) Validate ¶
func (m *RegisterReq) Validate() error
Validate checks the field values on RegisterReq with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*RegisterReq) XXX_DiscardUnknown ¶
func (m *RegisterReq) XXX_DiscardUnknown()
func (*RegisterReq) XXX_Marshal ¶
func (m *RegisterReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RegisterReq) XXX_Merge ¶
func (m *RegisterReq) XXX_Merge(src proto.Message)
func (*RegisterReq) XXX_Size ¶
func (m *RegisterReq) XXX_Size() int
func (*RegisterReq) XXX_Unmarshal ¶
func (m *RegisterReq) XXX_Unmarshal(b []byte) error
type RegisterReqValidationError ¶
type RegisterReqValidationError struct {
// contains filtered or unexported fields
}
RegisterReqValidationError is the validation error returned by RegisterReq.Validate if the designated constraints aren't met.
func (RegisterReqValidationError) Cause ¶
func (e RegisterReqValidationError) Cause() error
Cause function returns cause value.
func (RegisterReqValidationError) Error ¶
func (e RegisterReqValidationError) Error() string
Error satisfies the builtin error interface
func (RegisterReqValidationError) ErrorName ¶
func (e RegisterReqValidationError) ErrorName() string
ErrorName returns error name.
func (RegisterReqValidationError) Field ¶
func (e RegisterReqValidationError) Field() string
Field function returns field value.
func (RegisterReqValidationError) Key ¶
func (e RegisterReqValidationError) Key() bool
Key function returns key value.
func (RegisterReqValidationError) Reason ¶
func (e RegisterReqValidationError) Reason() string
Reason function returns reason value.
type Service ¶
type Service struct { //服务名称,project.service[.sub_service],例如live.session ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` //实例信息,根据zone(机房)进行分组 Instances map[string]*ZoneGroup `` /* 159-byte string literal not displayed */ //元组数据,用于扩展 Metadata map[string]string `` /* 157-byte string literal not displayed */ //service更新时间 UpdateTime int64 `protobuf:"varint,4,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` //service版本 Version int64 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
服务信息,可参考Service结构体
func (*Service) Descriptor ¶
func (*Service) GetInstances ¶
func (*Service) GetMetadata ¶
func (*Service) GetServiceName ¶
func (*Service) GetUpdateTime ¶
func (*Service) GetVersion ¶
func (*Service) ProtoMessage ¶
func (*Service) ProtoMessage()
func (*Service) Validate ¶
Validate checks the field values on Service with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*Service) XXX_DiscardUnknown ¶
func (m *Service) XXX_DiscardUnknown()
func (*Service) XXX_Marshal ¶
func (*Service) XXX_Unmarshal ¶
type ServiceValidationError ¶
type ServiceValidationError struct {
// contains filtered or unexported fields
}
ServiceValidationError is the validation error returned by Service.Validate if the designated constraints aren't met.
func (ServiceValidationError) Cause ¶
func (e ServiceValidationError) Cause() error
Cause function returns cause value.
func (ServiceValidationError) Error ¶
func (e ServiceValidationError) Error() string
Error satisfies the builtin error interface
func (ServiceValidationError) ErrorName ¶
func (e ServiceValidationError) ErrorName() string
ErrorName returns error name.
func (ServiceValidationError) Field ¶
func (e ServiceValidationError) Field() string
Field function returns field value.
func (ServiceValidationError) Key ¶
func (e ServiceValidationError) Key() bool
Key function returns key value.
func (ServiceValidationError) Reason ¶
func (e ServiceValidationError) Reason() string
Reason function returns reason value.
type SyncClient ¶
type SyncClient interface { //获取配置接口,如果请求的事件为CONFIG_EVENT_NONE且keeper中的配置没有发生改变,会阻塞n秒 Sync(ctx context.Context, opts ...grpc.CallOption) (Sync_SyncClient, error) }
SyncClient is the client API for Sync service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewSyncClient ¶
func NewSyncClient(cc *grpc.ClientConn) SyncClient
type SyncServer ¶
type SyncServer interface { //获取配置接口,如果请求的事件为CONFIG_EVENT_NONE且keeper中的配置没有发生改变,会阻塞n秒 Sync(Sync_SyncServer) error }
SyncServer is the server API for Sync service.
type Sync_SyncClient ¶
type Sync_SyncClient interface { Send(*ConfigEvent) error Recv() (*ConfigEvent, error) grpc.ClientStream }
type Sync_SyncServer ¶
type Sync_SyncServer interface { Send(*ConfigEvent) error Recv() (*ConfigEvent, error) grpc.ServerStream }
type UnimplementedDiscoveryServer ¶
type UnimplementedDiscoveryServer struct { }
UnimplementedDiscoveryServer can be embedded to have forward compatible implementations.
func (*UnimplementedDiscoveryServer) Deregister ¶
func (*UnimplementedDiscoveryServer) Deregister(ctx context.Context, req *DeregisterReq) (*empty.Empty, error)
func (*UnimplementedDiscoveryServer) KeepAlive ¶
func (*UnimplementedDiscoveryServer) KeepAlive(ctx context.Context, req *KeepAliveReq) (*empty.Empty, error)
func (*UnimplementedDiscoveryServer) Polls ¶
func (*UnimplementedDiscoveryServer) Polls(srv Discovery_PollsServer) error
func (*UnimplementedDiscoveryServer) Register ¶
func (*UnimplementedDiscoveryServer) Register(ctx context.Context, req *RegisterReq) (*empty.Empty, error)
type UnimplementedSyncServer ¶
type UnimplementedSyncServer struct { }
UnimplementedSyncServer can be embedded to have forward compatible implementations.
func (*UnimplementedSyncServer) Sync ¶
func (*UnimplementedSyncServer) Sync(srv Sync_SyncServer) error
type ZoneGroup ¶
type ZoneGroup struct { //实例群组 ZoneGroup map[string]*Instance `` /* 176-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
实例群组
func (*ZoneGroup) Descriptor ¶
func (*ZoneGroup) GetZoneGroup ¶
func (*ZoneGroup) ProtoMessage ¶
func (*ZoneGroup) ProtoMessage()
func (*ZoneGroup) Validate ¶
Validate checks the field values on ZoneGroup with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*ZoneGroup) XXX_DiscardUnknown ¶
func (m *ZoneGroup) XXX_DiscardUnknown()
func (*ZoneGroup) XXX_Marshal ¶
func (*ZoneGroup) XXX_Unmarshal ¶
type ZoneGroupValidationError ¶
type ZoneGroupValidationError struct {
// contains filtered or unexported fields
}
ZoneGroupValidationError is the validation error returned by ZoneGroup.Validate if the designated constraints aren't met.
func (ZoneGroupValidationError) Cause ¶
func (e ZoneGroupValidationError) Cause() error
Cause function returns cause value.
func (ZoneGroupValidationError) Error ¶
func (e ZoneGroupValidationError) Error() string
Error satisfies the builtin error interface
func (ZoneGroupValidationError) ErrorName ¶
func (e ZoneGroupValidationError) ErrorName() string
ErrorName returns error name.
func (ZoneGroupValidationError) Field ¶
func (e ZoneGroupValidationError) Field() string
Field function returns field value.
func (ZoneGroupValidationError) Key ¶
func (e ZoneGroupValidationError) Key() bool
Key function returns key value.
func (ZoneGroupValidationError) Reason ¶
func (e ZoneGroupValidationError) Reason() string
Reason function returns reason value.