Documentation ¶
Overview ¶
Package attachment provides a internal implementation of tRPC client/server attachment.
Index ¶
- func ClientRequestAttachment(msg codec.Msg) (io.Reader, bool)
- func ServerResponseAttachment(msg codec.Msg) (io.Reader, bool)
- func SetClientResponseAttachment(msg codec.Msg, attachment []byte)
- func SetServerRequestAttachment(m codec.Msg, attachment []byte)
- type Attachment
- type ClientAttachmentKey
- type NoopAttachment
- type ServerAttachmentKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientRequestAttachment ¶
ClientRequestAttachment returns client's Request Attachment from msg.
func ServerResponseAttachment ¶
ServerResponseAttachment returns server's Response Attachment from msg.
func SetClientResponseAttachment ¶
SetClientResponseAttachment sets client's Response attachment to msg. If the message does not contain client.Attachment, which means that the user has explicitly ignored the att returned by the server. For performance reasons, there is no need to set the response attachment into msg.
func SetServerRequestAttachment ¶
SetServerRequestAttachment sets server's Request Attachment to msg.
Types ¶
type Attachment ¶
Attachment stores the attachment in tRPC requests/responses.
type ClientAttachmentKey ¶
type ClientAttachmentKey struct{}
ClientAttachmentKey is the key of client's Attachment.
type ServerAttachmentKey ¶
type ServerAttachmentKey struct{}
ServerAttachmentKey is the key of server's Attachment.