Documentation ¶
Index ¶
- Constants
- Variables
- func GetOrDefault(key, def string) string
- func HmacSha256Base64(message string, secret string) string
- func RegisterServiceMessageServer(s *grpc.Server, srv ServiceMessageServer)
- type CcsSdk
- type EchoRequest
- type EchoResponse
- type MessageQueueRepository
- type MessageQueueService
- type MessageRequest
- func (*MessageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *MessageRequest) GetAppId() string
- func (x *MessageRequest) GetNeedRespReferers() bool
- func (x *MessageRequest) GetPayload() string
- func (x *MessageRequest) GetReferers() []*Referer
- func (x *MessageRequest) GetServiceId() string
- func (x *MessageRequest) GetTimestamp() int64
- func (x *MessageRequest) GetToken() string
- func (*MessageRequest) ProtoMessage()
- func (x *MessageRequest) ProtoReflect() protoreflect.Message
- func (x *MessageRequest) Reset()
- func (x *MessageRequest) String() string
- type MessageResponse
- func (*MessageResponse) Descriptor() ([]byte, []int)deprecated
- func (x *MessageResponse) GetAppId() string
- func (x *MessageResponse) GetCode() int32
- func (x *MessageResponse) GetPayload() string
- func (x *MessageResponse) GetReferers() []*Referer
- func (x *MessageResponse) GetRespServiceId() string
- func (x *MessageResponse) GetServiceId() string
- func (x *MessageResponse) GetTimestamp() int64
- func (*MessageResponse) ProtoMessage()
- func (x *MessageResponse) ProtoReflect() protoreflect.Message
- func (x *MessageResponse) Reset()
- func (x *MessageResponse) String() string
- type Referer
- type RequestHandleFunc
- type RequestHandleFuncs
- type RequestMessageContext
- type RequestMessageContextImpl
- func (x RequestMessageContextImpl) GetAppId() string
- func (x RequestMessageContextImpl) GetNeedRespReferers() bool
- func (x RequestMessageContextImpl) GetPayload() string
- func (x RequestMessageContextImpl) GetReferers() []*interface{}
- func (x RequestMessageContextImpl) GetServiceId() string
- func (x RequestMessageContextImpl) GetTimestamp() int64
- func (x RequestMessageContextImpl) GetToken() string
- type ResponseHandleFunc
- type ResponseHandleFuncs
- type ResponseMessageContext
- type ResponseMessageContextImpl
- func (x ResponseMessageContextImpl) GetAppId() string
- func (x ResponseMessageContextImpl) GetCode() int32
- func (x ResponseMessageContextImpl) GetPayload() string
- func (x ResponseMessageContextImpl) GetReferers() []*interface{}
- func (x ResponseMessageContextImpl) GetRespServiceId() string
- func (x ResponseMessageContextImpl) GetServiceId() string
- func (x ResponseMessageContextImpl) GetTimestamp() int64
- type RocketMQMessageQueueRepository
- type ServiceMessageClient
- type ServiceMessageServer
- type UnimplementedServiceMessageServer
Constants ¶
View Source
const ( CCS_ENDPOINTS = "" CCS_MQ_ENDPOINT = "CCS_MQ_ENDPOINT" CCS_MQ_REQ_TOPIC = "CCS_MQ_REQ_TOPIC" CCS_MQ_RESP_TOPIC = "CCS_MQ_RESP_TOPIC" CCS_APP_ID = "CCS_APP_ID" CCS_SERVICE_ID = "CCS_SERVICE_ID" CCS_SECRET_KEY = "CCS_SECRET_KEY" )
Variables ¶
View Source
var File_message_proto protoreflect.FileDescriptor
Functions ¶
func GetOrDefault ¶ added in v0.0.2
func HmacSha256Base64 ¶ added in v0.0.3
func RegisterServiceMessageServer ¶ added in v0.0.2
func RegisterServiceMessageServer(s *grpc.Server, srv ServiceMessageServer)
Types ¶
type CcsSdk ¶
type CcsSdk struct { CcsEndpoint string RequestHandlers RequestHandleFuncs ResponseHandlers ResponseHandleFuncs // contains filtered or unexported fields }
func NewCcsSdk ¶ added in v0.0.3
func NewCcsSdk(requestHandlers RequestHandleFuncs, responseHandlers ResponseHandleFuncs) (*CcsSdk, error)
type EchoRequest ¶ added in v0.0.2
type EchoRequest struct { Str string `protobuf:"bytes,1,opt,name=str,proto3" json:"str,omitempty"` // contains filtered or unexported fields }
func (*EchoRequest) Descriptor
deprecated
added in
v0.0.2
func (*EchoRequest) Descriptor() ([]byte, []int)
Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.
func (*EchoRequest) GetStr ¶ added in v0.0.2
func (x *EchoRequest) GetStr() string
func (*EchoRequest) ProtoMessage ¶ added in v0.0.2
func (*EchoRequest) ProtoMessage()
func (*EchoRequest) ProtoReflect ¶ added in v0.0.2
func (x *EchoRequest) ProtoReflect() protoreflect.Message
func (*EchoRequest) Reset ¶ added in v0.0.2
func (x *EchoRequest) Reset()
func (*EchoRequest) String ¶ added in v0.0.2
func (x *EchoRequest) String() string
type EchoResponse ¶ added in v0.0.2
type EchoResponse struct { Str string `protobuf:"bytes,1,opt,name=str,proto3" json:"str,omitempty"` // contains filtered or unexported fields }
func (*EchoResponse) Descriptor
deprecated
added in
v0.0.2
func (*EchoResponse) Descriptor() ([]byte, []int)
Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.
func (*EchoResponse) GetStr ¶ added in v0.0.2
func (x *EchoResponse) GetStr() string
func (*EchoResponse) ProtoMessage ¶ added in v0.0.2
func (*EchoResponse) ProtoMessage()
func (*EchoResponse) ProtoReflect ¶ added in v0.0.2
func (x *EchoResponse) ProtoReflect() protoreflect.Message
func (*EchoResponse) Reset ¶ added in v0.0.2
func (x *EchoResponse) Reset()
func (*EchoResponse) String ¶ added in v0.0.2
func (x *EchoResponse) String() string
type MessageQueueRepository ¶ added in v0.0.2
type MessageQueueRepository interface { SubscribeRequest(topic string, funcs RequestHandleFuncs) error SubscribeResponse(topic string, funcs ResponseHandleFuncs) error Start() error }
type MessageQueueService ¶ added in v0.0.2
type MessageQueueService struct {
Repo MessageQueueRepository
}
func NewMessageQueueService ¶ added in v0.0.2
func NewMessageQueueService(repo MessageQueueRepository) *MessageQueueService
func (*MessageQueueService) Start ¶ added in v0.0.3
func (s *MessageQueueService) Start() error
func (*MessageQueueService) SubscribeRequest ¶ added in v0.0.3
func (s *MessageQueueService) SubscribeRequest(topic string, funcs RequestHandleFuncs) error
func (*MessageQueueService) SubscribeResponse ¶ added in v0.0.3
func (s *MessageQueueService) SubscribeResponse(topic string, funcs ResponseHandleFuncs) error
type MessageRequest ¶ added in v0.0.2
type MessageRequest struct { AppId string `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // 最后一次被处理的时间戳 Payload string `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` Referers []*Referer `protobuf:"bytes,6,rep,name=referers,proto3" json:"referers,omitempty"` NeedRespReferers bool `protobuf:"varint,7,opt,name=need_resp_referers,json=needRespReferers,proto3" json:"need_resp_referers,omitempty"` // contains filtered or unexported fields }
请求消息类型
func (*MessageRequest) Descriptor
deprecated
added in
v0.0.2
func (*MessageRequest) Descriptor() ([]byte, []int)
Deprecated: Use MessageRequest.ProtoReflect.Descriptor instead.
func (*MessageRequest) GetAppId ¶ added in v0.0.2
func (x *MessageRequest) GetAppId() string
func (*MessageRequest) GetNeedRespReferers ¶ added in v0.0.2
func (x *MessageRequest) GetNeedRespReferers() bool
func (*MessageRequest) GetPayload ¶ added in v0.0.2
func (x *MessageRequest) GetPayload() string
func (*MessageRequest) GetReferers ¶ added in v0.0.2
func (x *MessageRequest) GetReferers() []*Referer
func (*MessageRequest) GetServiceId ¶ added in v0.0.2
func (x *MessageRequest) GetServiceId() string
func (*MessageRequest) GetTimestamp ¶ added in v0.0.2
func (x *MessageRequest) GetTimestamp() int64
func (*MessageRequest) GetToken ¶ added in v0.0.2
func (x *MessageRequest) GetToken() string
func (*MessageRequest) ProtoMessage ¶ added in v0.0.2
func (*MessageRequest) ProtoMessage()
func (*MessageRequest) ProtoReflect ¶ added in v0.0.2
func (x *MessageRequest) ProtoReflect() protoreflect.Message
func (*MessageRequest) Reset ¶ added in v0.0.2
func (x *MessageRequest) Reset()
func (*MessageRequest) String ¶ added in v0.0.2
func (x *MessageRequest) String() string
type MessageResponse ¶ added in v0.0.2
type MessageResponse struct { AppId string `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` RespServiceId string `protobuf:"bytes,3,opt,name=resp_service_id,json=respServiceId,proto3" json:"resp_service_id,omitempty"` Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // 最后一次被处理的时间戳 Payload string `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` Referers []*Referer `protobuf:"bytes,6,rep,name=referers,proto3" json:"referers,omitempty"` Code int32 `protobuf:"varint,7,opt,name=code,proto3" json:"code,omitempty"` // contains filtered or unexported fields }
返回消息类型
func (*MessageResponse) Descriptor
deprecated
added in
v0.0.2
func (*MessageResponse) Descriptor() ([]byte, []int)
Deprecated: Use MessageResponse.ProtoReflect.Descriptor instead.
func (*MessageResponse) GetAppId ¶ added in v0.0.2
func (x *MessageResponse) GetAppId() string
func (*MessageResponse) GetCode ¶ added in v0.0.2
func (x *MessageResponse) GetCode() int32
func (*MessageResponse) GetPayload ¶ added in v0.0.2
func (x *MessageResponse) GetPayload() string
func (*MessageResponse) GetReferers ¶ added in v0.0.2
func (x *MessageResponse) GetReferers() []*Referer
func (*MessageResponse) GetRespServiceId ¶ added in v0.0.2
func (x *MessageResponse) GetRespServiceId() string
func (*MessageResponse) GetServiceId ¶ added in v0.0.2
func (x *MessageResponse) GetServiceId() string
func (*MessageResponse) GetTimestamp ¶ added in v0.0.2
func (x *MessageResponse) GetTimestamp() int64
func (*MessageResponse) ProtoMessage ¶ added in v0.0.2
func (*MessageResponse) ProtoMessage()
func (*MessageResponse) ProtoReflect ¶ added in v0.0.2
func (x *MessageResponse) ProtoReflect() protoreflect.Message
func (*MessageResponse) Reset ¶ added in v0.0.2
func (x *MessageResponse) Reset()
func (*MessageResponse) String ¶ added in v0.0.2
func (x *MessageResponse) String() string
type Referer ¶ added in v0.0.2
type Referer struct { Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
请求消息的引用类型
func (*Referer) Descriptor
deprecated
added in
v0.0.2
func (*Referer) GetTimestamp ¶ added in v0.0.2
func (*Referer) ProtoMessage ¶ added in v0.0.2
func (*Referer) ProtoMessage()
func (*Referer) ProtoReflect ¶ added in v0.0.2
func (x *Referer) ProtoReflect() protoreflect.Message
type RequestHandleFunc ¶ added in v0.0.3
type RequestHandleFunc func(RequestMessageContext) error
func NewDefaultRequestHandler ¶ added in v0.0.3
func NewDefaultRequestHandler() RequestHandleFunc
type RequestHandleFuncs ¶ added in v0.0.3
type RequestHandleFuncs []RequestHandleFunc
func NewEmptyRequestHandlers ¶ added in v0.0.3
func NewEmptyRequestHandlers() RequestHandleFuncs
type RequestMessageContext ¶ added in v0.0.3
type RequestMessageContextImpl ¶ added in v0.0.3
type RequestMessageContextImpl struct { AppId string ServiceId string Token string Timestamp int64 Payload string Referers []*interface{} NeedRespReferers bool }
func (RequestMessageContextImpl) GetAppId ¶ added in v0.0.3
func (x RequestMessageContextImpl) GetAppId() string
func (RequestMessageContextImpl) GetNeedRespReferers ¶ added in v0.0.3
func (x RequestMessageContextImpl) GetNeedRespReferers() bool
func (RequestMessageContextImpl) GetPayload ¶ added in v0.0.3
func (x RequestMessageContextImpl) GetPayload() string
func (RequestMessageContextImpl) GetReferers ¶ added in v0.0.3
func (x RequestMessageContextImpl) GetReferers() []*interface{}
func (RequestMessageContextImpl) GetServiceId ¶ added in v0.0.3
func (x RequestMessageContextImpl) GetServiceId() string
func (RequestMessageContextImpl) GetTimestamp ¶ added in v0.0.3
func (x RequestMessageContextImpl) GetTimestamp() int64
func (RequestMessageContextImpl) GetToken ¶ added in v0.0.3
func (x RequestMessageContextImpl) GetToken() string
type ResponseHandleFunc ¶ added in v0.0.3
type ResponseHandleFunc func(ResponseMessageContext) error
func NewDefaultResponseHandler ¶ added in v0.0.3
func NewDefaultResponseHandler() ResponseHandleFunc
type ResponseHandleFuncs ¶ added in v0.0.3
type ResponseHandleFuncs []ResponseHandleFunc
func NewEmptyResponseHandlers ¶ added in v0.0.3
func NewEmptyResponseHandlers() ResponseHandleFuncs
type ResponseMessageContext ¶ added in v0.0.3
type ResponseMessageContextImpl ¶ added in v0.0.3
type ResponseMessageContextImpl struct { AppId string ServiceId string RespServiceId string Timestamp int64 Payload string Referers []*interface{} Code int32 }
func (ResponseMessageContextImpl) GetAppId ¶ added in v0.0.3
func (x ResponseMessageContextImpl) GetAppId() string
func (ResponseMessageContextImpl) GetCode ¶ added in v0.0.3
func (x ResponseMessageContextImpl) GetCode() int32
func (ResponseMessageContextImpl) GetPayload ¶ added in v0.0.3
func (x ResponseMessageContextImpl) GetPayload() string
func (ResponseMessageContextImpl) GetReferers ¶ added in v0.0.3
func (x ResponseMessageContextImpl) GetReferers() []*interface{}
func (ResponseMessageContextImpl) GetRespServiceId ¶ added in v0.0.3
func (x ResponseMessageContextImpl) GetRespServiceId() string
func (ResponseMessageContextImpl) GetServiceId ¶ added in v0.0.3
func (x ResponseMessageContextImpl) GetServiceId() string
func (ResponseMessageContextImpl) GetTimestamp ¶ added in v0.0.3
func (x ResponseMessageContextImpl) GetTimestamp() int64
type RocketMQMessageQueueRepository ¶ added in v0.0.2
type RocketMQMessageQueueRepository struct {
// contains filtered or unexported fields
}
func NewRocketMQMessageQueueRepository ¶ added in v0.0.2
func NewRocketMQMessageQueueRepository(nameServers []string) (*RocketMQMessageQueueRepository, error)
func (RocketMQMessageQueueRepository) Start ¶ added in v0.0.3
func (r RocketMQMessageQueueRepository) Start() error
func (RocketMQMessageQueueRepository) SubscribeRequest ¶ added in v0.0.3
func (r RocketMQMessageQueueRepository) SubscribeRequest(topic string, funcs RequestHandleFuncs) error
func (RocketMQMessageQueueRepository) SubscribeResponse ¶ added in v0.0.3
func (r RocketMQMessageQueueRepository) SubscribeResponse(topic string, funcs ResponseHandleFuncs) error
type ServiceMessageClient ¶ added in v0.0.2
type ServiceMessageClient interface { OnMessageRequest(ctx context.Context, in *MessageRequest, opts ...grpc.CallOption) (*MessageResponse, error) OnEcho(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) }
ServiceMessageClient is the client API for ServiceMessage service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewServiceMessageClient ¶ added in v0.0.2
func NewServiceMessageClient(cc grpc.ClientConnInterface) ServiceMessageClient
type ServiceMessageServer ¶ added in v0.0.2
type ServiceMessageServer interface { OnMessageRequest(context.Context, *MessageRequest) (*MessageResponse, error) OnEcho(context.Context, *EchoRequest) (*EchoResponse, error) }
ServiceMessageServer is the server API for ServiceMessage service.
type UnimplementedServiceMessageServer ¶ added in v0.0.2
type UnimplementedServiceMessageServer struct { }
UnimplementedServiceMessageServer can be embedded to have forward compatible implementations.
func (*UnimplementedServiceMessageServer) OnEcho ¶ added in v0.0.2
func (*UnimplementedServiceMessageServer) OnEcho(context.Context, *EchoRequest) (*EchoResponse, error)
func (*UnimplementedServiceMessageServer) OnMessageRequest ¶ added in v0.0.2
func (*UnimplementedServiceMessageServer) OnMessageRequest(context.Context, *MessageRequest) (*MessageResponse, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.