Documentation ¶
Index ¶
- Constants
- func RegisterBiRequestStreamServer(s *grpc.Server, srv BiRequestStreamServer)
- func RegisterRequestServer(s *grpc.Server, srv RequestServer)
- type BaseRequest
- type BaseResponse
- type BatchInstanceRequest
- type BatchInstanceResponse
- type BiRequestStreamClient
- type BiRequestStreamServer
- type BiRequestStream_RequestBiStreamClient
- type BiRequestStream_RequestBiStreamServer
- type ClientAbilities
- type ClientDetectionRequest
- type ClientDetectionResponse
- type ConnectResetRequest
- type ConnectResetResponse
- type ConnectionSetupRequest
- type CustomerPayload
- type ErrorResponse
- type HealthCheckRequest
- type HealthCheckResponse
- type InstanceRequest
- type InstanceResponse
- type InternalRequest
- type Metadata
- func (*Metadata) Descriptor() ([]byte, []int)
- func (m *Metadata) GetClientIp() string
- func (m *Metadata) GetHeaders() map[string]string
- func (m *Metadata) GetType() string
- func (*Metadata) ProtoMessage()
- func (m *Metadata) Reset()
- func (m *Metadata) String() string
- func (m *Metadata) XXX_DiscardUnknown()
- func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Metadata) XXX_Merge(src proto.Message)
- func (m *Metadata) XXX_Size() int
- func (m *Metadata) XXX_Unmarshal(b []byte) error
- type NamingRequest
- type NotifySubscriberRequest
- type NotifySubscriberResponse
- type Payload
- func (*Payload) Descriptor() ([]byte, []int)
- func (m *Payload) GetBody() *anypb.Any
- func (m *Payload) GetMetadata() *Metadata
- func (*Payload) ProtoMessage()
- func (m *Payload) Reset()
- func (m *Payload) String() string
- func (m *Payload) XXX_DiscardUnknown()
- func (m *Payload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Payload) XXX_Merge(src proto.Message)
- func (m *Payload) XXX_Size() int
- func (m *Payload) XXX_Unmarshal(b []byte) error
- type QueryServiceResponse
- type Request
- type RequestClient
- type RequestMeta
- type RequestServer
- type Response
- type ServerCheckRequest
- type ServerCheckResponse
- type ServiceListRequest
- type ServiceListResponse
- type ServiceQueryRequest
- type SubscribeServiceRequest
- type SubscribeServiceResponse
Constants ¶
const ( // TypeConnectionSetupRequest TypeConnectionSetupRequest = "ConnectionSetupRequest" // TypeServerCheckRequest TypeServerCheckRequest = "ServerCheckRequest" // TypeInstanceRequest TypeInstanceRequest = "InstanceRequest" // TypeBatchInstanceRequest TypeBatchInstanceRequest = "BatchInstanceRequest" )
Variables ¶
This section is empty.
Functions ¶
func RegisterBiRequestStreamServer ¶
func RegisterBiRequestStreamServer(s *grpc.Server, srv BiRequestStreamServer)
func RegisterRequestServer ¶
func RegisterRequestServer(s *grpc.Server, srv RequestServer)
Types ¶
type BaseRequest ¶
type BaseRequest interface { GetHeaders() map[string]string GetRequestType() string GetBody(request BaseRequest) string PutAllHeaders(headers map[string]string) GetRequestId() string GetStringToSign() string }
BaseRequest
type BaseResponse ¶
type BaseResponse interface { GetResponseType() string SetRequestId(requestId string) GetRequestId() string GetBody() string GetErrorCode() int IsSuccess() bool GetResultCode() int GetMessage() string }
BaseResponse
type BatchInstanceRequest ¶
type BatchInstanceRequest struct { *NamingRequest Type string `json:"type"` Instances []*model.Instance `json:"instances"` }
BatchInstanceRequest .
func (*BatchInstanceRequest) GetRequestType ¶
func (r *BatchInstanceRequest) GetRequestType() string
func (*BatchInstanceRequest) Normalize ¶
func (r *BatchInstanceRequest) Normalize()
type BatchInstanceResponse ¶
type BatchInstanceResponse struct {
*Response
}
BatchInstanceResponse
func (*BatchInstanceResponse) GetResponseType ¶
func (c *BatchInstanceResponse) GetResponseType() string
type BiRequestStreamClient ¶
type BiRequestStreamClient interface { // Sends a commonRequest RequestBiStream(ctx context.Context, opts ...grpc.CallOption) (BiRequestStream_RequestBiStreamClient, error) }
BiRequestStreamClient is the client API for BiRequestStream service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewBiRequestStreamClient ¶
func NewBiRequestStreamClient(cc *grpc.ClientConn) BiRequestStreamClient
type BiRequestStreamServer ¶
type BiRequestStreamServer interface { // Sends a commonRequest RequestBiStream(BiRequestStream_RequestBiStreamServer) error }
BiRequestStreamServer is the server API for BiRequestStream service.
type ClientDetectionRequest ¶
type ClientDetectionRequest struct {
*InternalRequest
}
ClientDetectionRequest
func NewClientDetectionRequest ¶
func NewClientDetectionRequest() *ClientDetectionRequest
func (*ClientDetectionRequest) GetRequestType ¶
func (r *ClientDetectionRequest) GetRequestType() string
type ClientDetectionResponse ¶
type ClientDetectionResponse struct {
*Response
}
ClientDetectionResponse
func (*ClientDetectionResponse) GetResponseType ¶
func (c *ClientDetectionResponse) GetResponseType() string
type ConnectResetRequest ¶
type ConnectResetRequest struct { *InternalRequest ServerIp string ServerPort string }
ConnectResetRequest
func (*ConnectResetRequest) GetRequestType ¶
func (r *ConnectResetRequest) GetRequestType() string
type ConnectResetResponse ¶
type ConnectResetResponse struct {
*Response
}
ConnectResetResponse
func (*ConnectResetResponse) GetResponseType ¶
func (c *ConnectResetResponse) GetResponseType() string
type ConnectionSetupRequest ¶
type ConnectionSetupRequest struct { *InternalRequest ClientVersion string `json:"clientVersion"` Tenant string `json:"tenant"` Labels map[string]string `json:"labels"` ClientAbilities ClientAbilities `json:"clientAbilities"` }
ConnectionSetupRequest
func NewConnectionSetupRequest ¶
func NewConnectionSetupRequest() *ConnectionSetupRequest
NewConnectionSetupRequest .
func (*ConnectionSetupRequest) GetRequestType ¶
func (r *ConnectionSetupRequest) GetRequestType() string
type ErrorResponse ¶
type ErrorResponse struct {
*Response
}
ErrorResponse
func (*ErrorResponse) GetResponseType ¶
func (c *ErrorResponse) GetResponseType() string
type HealthCheckRequest ¶
type HealthCheckRequest struct {
*InternalRequest
}
HealthCheckRequest
func NewHealthCheckRequest ¶
func NewHealthCheckRequest() *HealthCheckRequest
NewHealthCheckRequest .
func (*HealthCheckRequest) GetRequestType ¶
func (r *HealthCheckRequest) GetRequestType() string
type HealthCheckResponse ¶
type HealthCheckResponse struct {
*Response
}
HealthCheckResponse
func NewHealthCheckResponse ¶
func NewHealthCheckResponse() *HealthCheckResponse
NewHealthCheckResponse
func (*HealthCheckResponse) GetResponseType ¶
func (c *HealthCheckResponse) GetResponseType() string
type InstanceRequest ¶
type InstanceRequest struct { *NamingRequest Type string `json:"type"` Instance model.Instance `json:"instance"` }
InstanceRequest
func NewInstanceRequest ¶
func NewInstanceRequest(namespace, serviceName, groupName, reqType string, instance model.Instance) *InstanceRequest
NewInstanceRequest
func (*InstanceRequest) GetRequestType ¶
func (r *InstanceRequest) GetRequestType() string
type InstanceResponse ¶
type InstanceResponse struct {
*Response
}
InstanceResponse
func (*InstanceResponse) GetResponseType ¶
func (c *InstanceResponse) GetResponseType() string
type InternalRequest ¶
InternalRequest
type Metadata ¶
type Metadata struct { Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` ClientIp string `protobuf:"bytes,8,opt,name=clientIp,proto3" json:"clientIp,omitempty"` Headers map[string]string `` /* 155-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Metadata) Descriptor ¶
func (*Metadata) GetClientIp ¶
func (*Metadata) GetHeaders ¶
func (*Metadata) ProtoMessage ¶
func (*Metadata) ProtoMessage()
func (*Metadata) XXX_DiscardUnknown ¶
func (m *Metadata) XXX_DiscardUnknown()
func (*Metadata) XXX_Marshal ¶
func (*Metadata) XXX_Unmarshal ¶
type NamingRequest ¶
type NamingRequest struct { *Request Namespace string `json:"namespace"` ServiceName string `json:"serviceName"` GroupName string `json:"groupName"` Module string `json:"module"` }
NamingRequest
func NewNamingRequest ¶
func NewNamingRequest(namespace, serviceName, groupName string) *NamingRequest
NewNamingRequest
func (*NamingRequest) GetStringToSign ¶
func (r *NamingRequest) GetStringToSign() string
type NotifySubscriberRequest ¶
type NotifySubscriberRequest struct { *NamingRequest ServiceInfo model.ServiceInfo `json:"serviceInfo"` }
NotifySubscriberRequest
func (*NotifySubscriberRequest) GetRequestType ¶
func (r *NotifySubscriberRequest) GetRequestType() string
type NotifySubscriberResponse ¶
type NotifySubscriberResponse struct {
*Response
}
NotifySubscriberResponse
func (*NotifySubscriberResponse) GetResponseType ¶
func (c *NotifySubscriberResponse) GetResponseType() string
type Payload ¶
type Payload struct { Metadata *Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` Body *anypb.Any `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Payload) Descriptor ¶
func (*Payload) GetMetadata ¶
func (*Payload) ProtoMessage ¶
func (*Payload) ProtoMessage()
func (*Payload) XXX_DiscardUnknown ¶
func (m *Payload) XXX_DiscardUnknown()
func (*Payload) XXX_Marshal ¶
func (*Payload) XXX_Unmarshal ¶
type QueryServiceResponse ¶
QueryServiceResponse
func (*QueryServiceResponse) GetResponseType ¶
func (c *QueryServiceResponse) GetResponseType() string
type Request ¶
Request
func (*Request) ClearHeaders ¶
func (r *Request) ClearHeaders()
func (*Request) GetBody ¶
func (r *Request) GetBody(request BaseRequest) string
func (*Request) GetHeaders ¶
func (*Request) GetRequestId ¶
func (*Request) GetStringToSign ¶
func (*Request) PutAllHeaders ¶
type RequestClient ¶
type RequestClient interface { // Sends a commonRequest Request(ctx context.Context, in *Payload, opts ...grpc.CallOption) (*Payload, error) }
RequestClient is the client API for Request service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewRequestClient ¶
func NewRequestClient(cc *grpc.ClientConn) RequestClient
type RequestMeta ¶
type RequestMeta struct { ConnectionID string ClientIP string ClientVersion string Labels map[string]string }
RequestMeta
type RequestServer ¶
type RequestServer interface { // Sends a commonRequest Request(context.Context, *Payload) (*Payload, error) }
RequestServer is the server API for Request service.
type Response ¶
type Response struct { ResultCode int `json:"resultCode"` ErrorCode int `json:"errorCode"` Success bool `json:"success"` Message string `json:"message"` RequestId string `json:"requestId"` }
Response
func (*Response) GetErrorCode ¶
func (*Response) GetMessage ¶
func (*Response) GetRequestId ¶
func (*Response) GetResultCode ¶
func (*Response) SetRequestId ¶
type ServerCheckRequest ¶
type ServerCheckRequest struct {
*InternalRequest
}
ServerCheckRequest
func NewServerCheckRequest ¶
func NewServerCheckRequest() *ServerCheckRequest
NewServerCheckRequest .
func (*ServerCheckRequest) GetRequestType ¶
func (r *ServerCheckRequest) GetRequestType() string
type ServerCheckResponse ¶
ServerCheckResponse
func NewServerCheckResponse ¶
func NewServerCheckResponse() *ServerCheckResponse
NewServerCheckResponse
func (*ServerCheckResponse) GetResponseType ¶
func (c *ServerCheckResponse) GetResponseType() string
type ServiceListRequest ¶
type ServiceListRequest struct { *NamingRequest PageNo int `json:"pageNo"` PageSize int `json:"pageSize"` Selector string `json:"selector"` }
ServiceListRequest
func NewServiceListRequest ¶
func NewServiceListRequest(namespace, serviceName, groupName string, pageNo, pageSize int, selector string) *ServiceListRequest
NewServiceListRequest .
func (*ServiceListRequest) GetRequestType ¶
func (r *ServiceListRequest) GetRequestType() string
type ServiceListResponse ¶
type ServiceListResponse struct { *Response Count int `json:"count"` ServiceNames []string `json:"serviceNames"` }
ServiceListResponse
func (*ServiceListResponse) GetResponseType ¶
func (c *ServiceListResponse) GetResponseType() string
type ServiceQueryRequest ¶
type ServiceQueryRequest struct { *NamingRequest Cluster string `json:"cluster"` HealthyOnly bool `json:"healthyOnly"` UdpPort int `json:"udpPort"` }
ServiceQueryRequest
func NewServiceQueryRequest ¶
func NewServiceQueryRequest(namespace, serviceName, groupName, cluster string, healthyOnly bool, udpPort int) *ServiceQueryRequest
NewServiceQueryRequest .
func (*ServiceQueryRequest) GetRequestType ¶
func (r *ServiceQueryRequest) GetRequestType() string
type SubscribeServiceRequest ¶
type SubscribeServiceRequest struct { *NamingRequest Subscribe bool `json:"subscribe"` Clusters string `json:"clusters"` }
SubscribeServiceRequest
func NewSubscribeServiceRequest ¶
func NewSubscribeServiceRequest(namespace, serviceName, groupName, clusters string, subscribe bool) *SubscribeServiceRequest
NewSubscribeServiceRequest .
func (*SubscribeServiceRequest) GetRequestType ¶
func (r *SubscribeServiceRequest) GetRequestType() string
type SubscribeServiceResponse ¶
type SubscribeServiceResponse struct { *Response ServiceInfo model.ServiceInfo `json:"serviceInfo"` }
SubscribeServiceResponse
func (*SubscribeServiceResponse) GetResponseType ¶
func (c *SubscribeServiceResponse) GetResponseType() string