Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var InvalidSignatureError = errors.New("A message had an invalid signature")
InvalidSignatureError is returned when the signature on a received message does not validate.
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct {
ID string `json:"msg_id"`
Username string `json:"username"`
Session string `json:"session"`
Type MessageType `json:"msg_type"`
Date time.Time `json:"date"`
Version string `json:"version"`
}
The message header contains a pair of unique identifiers for the originating session and the actual message id, in addition to the username for the process that generated the message. This is useful in collaborative settings where multiple users may be interacting with the same kernel simultaneously, so that frontends can label the various messages in a meaningful way.
type Message ¶
type Message struct {
Header Header `json:"header"`
// In a chain of messages, the header from the parent is copied so that
// clients can track where messages come from.
ParentHeader Header `json:"parent_header"`
// Any metadata associated with the message.
Metadata map[string]interface{} `json:"metadata"`
// The actual content of the message must be a dict, whose structure
// depends on the message type.
Content interface{} `json:"content"`
// optional: buffers is a list of binary data buffers for implementations
// that support binary extensions to the protocol.
Buffer []string `json:"buffer"`
}
func FromWire ¶
NewFromWire translates a multipart ZMQ messages received from a socket into a Message struct and a slice of return identities. This includes verifying the message signature.
type MessageType ¶
type MessageType string
const ( ErrorReplyType MessageType = "error" CommCloseType MessageType = "comm_close" CommInfoRequestType MessageType = "comm_info_request" CommMessageType MessageType = "comm_msg" CommOpenType MessageType = "comm_open" CompleteRequestType MessageType = "complete_request" ConnectReplyType MessageType = "connect_reply" ConnectRequestType MessageType = "connect_request" ExecuteReplyType MessageType = "execute_reply" ExecuteRequestType MessageType = "execute_request" ExecuteResultType MessageType = "execute_result" HistoryRequestType MessageType = "history_request" InspectRequestType MessageType = "inspect_request" IsCompleteRequestType MessageType = "is_complete_request" KernelInfoReplyType MessageType = "kernel_info_reply" KernelInfoRequestType MessageType = "kernel_info_request" ShutdownReplyType MessageType = "shutdown_reply" ShutdownRequestType MessageType = "shutdown_request" StatusType MessageType = "status" )
type Receipt ¶
type Receipt struct {
Message Message
Identities [][]byte
Connection *connection.Connection
}
Click to show internal directories.
Click to hide internal directories.