Versions in this module Expand all Collapse all v0 v0.0.1 Nov 25, 2024 Changes in this version + const ContextMsg + const EncryptFrameHeadLen + const EncryptVersion + const FrameHeadLen + const FrameTypeEncrypt + const FrameTypeNormal + const FrameTypeSignature + const ProtocolTypeHTTP + const ProtocolTypeRPC + const ProtocolVersion + const SignFrameHeadLen + const SignVersion + var ErrFrameTooLarge = errors.New("length of frame is larger than MaxFrameSize") + var ErrHeadOverflowsUint16 = errors.New("head len overflows uint16") + var ErrHeadOverflowsUint32 = errors.New("total len overflows uint32") + var MaxFrameSize = 10 * 1024 * 1024 + func CloneContext(ctx context.Context) context.Context + func CopyMsg(dst, src *Msg) + func RecycleMessage(msg *Msg) + type EncryptFrameHead struct + FrameType uint8 + ProtocolType uint8 + TotalLen uint32 + Version uint8 + WorkspaceID uint32 + func NewEncryptFrameHead() *EncryptFrameHead + func (h *EncryptFrameHead) Construct(workspaceID int, token, frameBody []byte) ([]byte, error) + func (h *EncryptFrameHead) Extract(buf []byte) + type FrameHead struct + FrameType uint8 + HeaderLen uint16 + Reserved uint16 + TotalLen uint32 + Version uint8 + func NewFrameHead() *FrameHead + func (h *FrameHead) Construct(header, body []byte) ([]byte, error) + func (h *FrameHead) Extract(buf []byte) + type Msg struct + func Message(ctx context.Context) *Msg + func NewAsyncMessage(ctx context.Context, duration time.Duration) (context.Context, context.CancelFunc, *Msg) + func NewMessage(ctx context.Context) (context.Context, *Msg) + func (m *Msg) CallRPCName() string + func (m *Msg) CalleeMethod() string + func (m *Msg) CalleeServiceName() string + func (m *Msg) CallerMethod() string + func (m *Msg) CallerServiceName() string + func (m *Msg) ClientReqHead() interface{} + func (m *Msg) ClientRespError() error + func (m *Msg) ClientRespHead() interface{} + func (m *Msg) Context() context.Context + func (m *Msg) Env() string + func (m *Msg) FrameCodec() interface{} + func (m *Msg) LocalAddr() net.Addr + func (m *Msg) LogSeq() int + func (m *Msg) Logger() logger.Logger + func (m *Msg) RemoteAddr() net.Addr + func (m *Msg) RequestID() uint64 + func (m *Msg) RequestTimeout() time.Duration + func (m *Msg) SerializationType() int + func (m *Msg) ServerReqHead() interface{} + func (m *Msg) ServerRespError() *errs.Error + func (m *Msg) ServerRespHead() interface{} + func (m *Msg) SpanID() uint64 + func (m *Msg) TraceID() string + func (m *Msg) WithCallRPCName(s string) + func (m *Msg) WithCalleeMethod(s string) + func (m *Msg) WithCalleeServiceName(s string) + func (m *Msg) WithCallerMethod(s string) + func (m *Msg) WithCallerServiceName(s string) + func (m *Msg) WithClientReqHead(h interface{}) + func (m *Msg) WithClientRespError(e error) + func (m *Msg) WithClientRespHead(h interface{}) + func (m *Msg) WithEnv(env string) + func (m *Msg) WithFrameCodec(f interface{}) + func (m *Msg) WithLocalAddr(addr net.Addr) + func (m *Msg) WithLogger(l logger.Logger) + func (m *Msg) WithRemoteAddr(addr net.Addr) + func (m *Msg) WithRequestID(id uint64) + func (m *Msg) WithRequestTimeout(t time.Duration) + func (m *Msg) WithSerializationType(t int) + func (m *Msg) WithServerReqHead(h interface{}) + func (m *Msg) WithServerRespError(e error) + func (m *Msg) WithServerRespHead(h interface{}) + func (m *Msg) WithSpanID(id uint64) + func (m *Msg) WithTraceID(id string) + type SignFrameHead struct + FrameType uint8 + ProtocolType uint8 + Sign []byte + TotalLen uint32 + Version uint8 + WorkSpaceID uint32 + func NewSignFrameHead() *SignFrameHead + func (h *SignFrameHead) Construct(workspaceID int, token, frameBody []byte) ([]byte, error) + func (h *SignFrameHead) Extract(buf []byte)