pb

package
v0.0.0-...-d989b54 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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",
}
View Source
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,
}
View Source
var DiscoveryEventType_name = map[int32]string{
	0: "_DISCOVERY_EVENT_TYPE_",
	1: "DISCOVERY_EVENT_NONE",
	2: "DISCOVERY_EVENT_UPDATE",
}
View Source
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

Cause function returns cause value.

func (ConfigEventValidationError) Error

Error satisfies the builtin error interface

func (ConfigEventValidationError) ErrorName

func (e ConfigEventValidationError) ErrorName() string

ErrorName returns error name.

func (ConfigEventValidationError) Field

Field function returns field value.

func (ConfigEventValidationError) Key

Key function returns key value.

func (ConfigEventValidationError) Reason

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

Cause function returns cause value.

func (DeregisterReqValidationError) Error

Error satisfies the builtin error interface

func (DeregisterReqValidationError) ErrorName

func (e DeregisterReqValidationError) ErrorName() string

ErrorName returns error name.

func (DeregisterReqValidationError) Field

Field function returns field value.

func (DeregisterReqValidationError) Key

Key function returns key value.

func (DeregisterReqValidationError) Reason

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_PollsClient interface {
	Send(*PollsReq) error
	Recv() (*PollsResp, error)
	grpc.ClientStream
}

type Discovery_PollsServer

type Discovery_PollsServer interface {
	Send(*PollsResp) error
	Recv() (*PollsReq, error)
	grpc.ServerStream
}

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) Descriptor() ([]byte, []int)

func (*Instance) GetAddrs

func (m *Instance) GetAddrs() map[string]string

func (*Instance) GetEnv

func (m *Instance) GetEnv() string

func (*Instance) GetHostname

func (m *Instance) GetHostname() string

func (*Instance) GetId

func (m *Instance) GetId() string

func (*Instance) GetMetadata

func (m *Instance) GetMetadata() map[string]string

func (*Instance) GetRegTime

func (m *Instance) GetRegTime() int64

func (*Instance) GetServiceName

func (m *Instance) GetServiceName() string

func (*Instance) GetUpdateTime

func (m *Instance) GetUpdateTime() int64

func (*Instance) GetZone

func (m *Instance) GetZone() string

func (*Instance) ProtoMessage

func (*Instance) ProtoMessage()

func (*Instance) Reset

func (m *Instance) Reset()

func (*Instance) String

func (m *Instance) String() string

func (*Instance) Validate

func (m *Instance) Validate() error

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 (m *Instance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Instance) XXX_Merge

func (m *Instance) XXX_Merge(src proto.Message)

func (*Instance) XXX_Size

func (m *Instance) XXX_Size() int

func (*Instance) XXX_Unmarshal

func (m *Instance) XXX_Unmarshal(b []byte) error

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

Cause function returns cause value.

func (KeepAliveReqValidationError) Error

Error satisfies the builtin error interface

func (KeepAliveReqValidationError) ErrorName

func (e KeepAliveReqValidationError) ErrorName() string

ErrorName returns error name.

func (KeepAliveReqValidationError) Field

Field function returns field value.

func (KeepAliveReqValidationError) Key

Key function returns key value.

func (KeepAliveReqValidationError) Reason

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) Descriptor() ([]byte, []int)

func (*PollsReq) GetEnv

func (m *PollsReq) GetEnv() string

func (*PollsReq) GetPollServices

func (m *PollsReq) GetPollServices() map[string]int64

func (*PollsReq) GetSubscriber

func (m *PollsReq) GetSubscriber() string

func (*PollsReq) ProtoMessage

func (*PollsReq) ProtoMessage()

func (*PollsReq) Reset

func (m *PollsReq) Reset()

func (*PollsReq) String

func (m *PollsReq) String() string

func (*PollsReq) Validate

func (m *PollsReq) Validate() error

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 (m *PollsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PollsReq) XXX_Merge

func (m *PollsReq) XXX_Merge(src proto.Message)

func (*PollsReq) XXX_Size

func (m *PollsReq) XXX_Size() int

func (*PollsReq) XXX_Unmarshal

func (m *PollsReq) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*PollsResp) GetEventType

func (m *PollsResp) GetEventType() DiscoveryEventType

func (*PollsResp) GetServices

func (m *PollsResp) GetServices() map[string]*Service

func (*PollsResp) ProtoMessage

func (*PollsResp) ProtoMessage()

func (*PollsResp) Reset

func (m *PollsResp) Reset()

func (*PollsResp) String

func (m *PollsResp) String() string

func (*PollsResp) Validate

func (m *PollsResp) Validate() error

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 (m *PollsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PollsResp) XXX_Merge

func (m *PollsResp) XXX_Merge(src proto.Message)

func (*PollsResp) XXX_Size

func (m *PollsResp) XXX_Size() int

func (*PollsResp) XXX_Unmarshal

func (m *PollsResp) XXX_Unmarshal(b []byte) error

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

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

Cause function returns cause value.

func (RegisterReqValidationError) Error

Error satisfies the builtin error interface

func (RegisterReqValidationError) ErrorName

func (e RegisterReqValidationError) ErrorName() string

ErrorName returns error name.

func (RegisterReqValidationError) Field

Field function returns field value.

func (RegisterReqValidationError) Key

Key function returns key value.

func (RegisterReqValidationError) Reason

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) Descriptor() ([]byte, []int)

func (*Service) GetInstances

func (m *Service) GetInstances() map[string]*ZoneGroup

func (*Service) GetMetadata

func (m *Service) GetMetadata() map[string]string

func (*Service) GetServiceName

func (m *Service) GetServiceName() string

func (*Service) GetUpdateTime

func (m *Service) GetUpdateTime() int64

func (*Service) GetVersion

func (m *Service) GetVersion() int64

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) Reset

func (m *Service) Reset()

func (*Service) String

func (m *Service) String() string

func (*Service) Validate

func (m *Service) Validate() error

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 (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Service) XXX_Merge

func (m *Service) XXX_Merge(src proto.Message)

func (*Service) XXX_Size

func (m *Service) XXX_Size() int

func (*Service) XXX_Unmarshal

func (m *Service) XXX_Unmarshal(b []byte) error

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) KeepAlive

func (*UnimplementedDiscoveryServer) Polls

func (*UnimplementedDiscoveryServer) Register

type UnimplementedSyncServer

type UnimplementedSyncServer struct {
}

UnimplementedSyncServer can be embedded to have forward compatible implementations.

func (*UnimplementedSyncServer) Sync

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) Descriptor() ([]byte, []int)

func (*ZoneGroup) GetZoneGroup

func (m *ZoneGroup) GetZoneGroup() map[string]*Instance

func (*ZoneGroup) ProtoMessage

func (*ZoneGroup) ProtoMessage()

func (*ZoneGroup) Reset

func (m *ZoneGroup) Reset()

func (*ZoneGroup) String

func (m *ZoneGroup) String() string

func (*ZoneGroup) Validate

func (m *ZoneGroup) Validate() error

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 (m *ZoneGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ZoneGroup) XXX_Merge

func (m *ZoneGroup) XXX_Merge(src proto.Message)

func (*ZoneGroup) XXX_Size

func (m *ZoneGroup) XXX_Size() int

func (*ZoneGroup) XXX_Unmarshal

func (m *ZoneGroup) XXX_Unmarshal(b []byte) error

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

Key function returns key value.

func (ZoneGroupValidationError) Reason

func (e ZoneGroupValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL