Documentation ¶
Index ¶
- Constants
- Variables
- func ConsumerContext(traceID string, d time.Duration) (ctx context.Context, cancel context.CancelFunc)
- func ObserveMsg(topic, name, status, reason string, start time.Time)
- func WarpMessage(ctx context.Context, tag string, msg proto.Message) ([]byte, error)
- type Consumer
- type ConsumerMeta
- type HandleFunc
- type MqMessage
- func (*MqMessage) Descriptor() ([]byte, []int)
- func (m *MqMessage) GetMessage() []byte
- func (m *MqMessage) GetTag() string
- func (m *MqMessage) GetTraceId() string
- func (m *MqMessage) GetTxId() string
- func (m *MqMessage) Marshal() (dAtA []byte, err error)
- func (m *MqMessage) MarshalTo(dAtA []byte) (int, error)
- func (m *MqMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MqMessage) ProtoMessage()
- func (m *MqMessage) Reset()
- func (m *MqMessage) Size() (n int)
- func (m *MqMessage) String() string
- func (m *MqMessage) Unmarshal(dAtA []byte) error
- func (m *MqMessage) XXX_DiscardUnknown()
- func (m *MqMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MqMessage) XXX_Merge(src proto.Message)
- func (m *MqMessage) XXX_Size() int
- func (m *MqMessage) XXX_Unmarshal(b []byte) error
- type Option
Constants ¶
View Source
const ( DefaultHandlerQueueSize = 100 TagCreate = "create" TagReply = "reply" TagDelete = "delete" TagSync = "sync" TagListMissed = "list_missed" TagSubListMissed = "sub_list_missed" TagLike = "like" TagHate = "hate" )
Variables ¶
View Source
var ( ErrInvalidLengthMessage = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowMessage = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupMessage = fmt.Errorf("proto: unexpected end of group") )
View Source
var ( ApiLogger *log.Logger ExcLogger *log.Logger MetricEventHandlerMsgDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "event_handler_msg_duration", Help: "消息处理延时", Buckets: prometheus.DefBuckets, }, []string{"name", "topic", "status", "reason"}) )
Functions ¶
func ConsumerContext ¶ added in v0.0.3
func ObserveMsg ¶ added in v0.0.3
Types ¶
type ConsumerMeta ¶ added in v0.0.3
type MqMessage ¶ added in v0.0.3
type MqMessage struct { TxId string `protobuf:"bytes,1,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` TraceId string `protobuf:"bytes,2,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` Tag string `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"` Message []byte `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*MqMessage) Descriptor ¶ added in v0.0.3
func (*MqMessage) GetMessage ¶ added in v0.0.3
func (*MqMessage) GetTraceId ¶ added in v0.0.3
func (*MqMessage) MarshalToSizedBuffer ¶ added in v0.0.3
func (*MqMessage) ProtoMessage ¶ added in v0.0.3
func (*MqMessage) ProtoMessage()
func (*MqMessage) XXX_DiscardUnknown ¶ added in v0.0.3
func (m *MqMessage) XXX_DiscardUnknown()
func (*MqMessage) XXX_Marshal ¶ added in v0.0.3
func (*MqMessage) XXX_Unmarshal ¶ added in v0.0.3
type Option ¶ added in v0.0.3
type Option func(*ConsumerMeta)
func WithProcTimeout ¶ added in v0.0.3
Source Files ¶
Click to show internal directories.
Click to hide internal directories.