Documentation ¶
Overview ¶
Package kernel is mostly copied from by https://github.com/gopherdata/gophernotes.
Package kernel is mostly copied from by https://github.com/gopherdata/gophernotes.
Package kernel is mostly copied from by https://github.com/gopherdata/gophernotes.
Package kernel is mostly copied from by https://github.com/gopherdata/gophernotes.
Package kernel is mostly copied from by https://github.com/gopherdata/gophernotes.
Index ¶
Constants ¶
const ( // StreamStdout defines the stream name for standard out on the front-end. It // is used in `PublishWriteStream` to specify the stream to write to. StreamStdout = "stdout" // StreamStderr defines the stream name for standard error on the front-end. It // is used in `PublishWriteStream` to specify the stream to write to. StreamStderr = "stderr" )
Variables ¶
var ( // ExecCounter is incremented each time we run user code in the notebook. // It cannot be defined in Kernel struct, or it will be always 1. ExecCounter = 0 )
Functions ¶
This section is empty.
Types ¶
type BundledMIMEData ¶
type BundledMIMEData map[string]interface{}
bundledMIMEData holds data that can be presented in multiple formats. The keys are MIME types and the values are the data formatted with respect to its MIME type. All bundles should contain at least a "text/plain" representation with a string value.
type ComposedMsg ¶
type ComposedMsg struct { Header MsgHeader ParentHeader MsgHeader Metadata map[string]interface{} Content interface{} }
ComposedMsg represents an entire message in a high-level structure.
func NewMsg ¶
func NewMsg(msgType string, parent ComposedMsg) (ComposedMsg, error)
NewMsg creates a new ComposedMsg to respond to a parent message. This includes setting up its headers.
func WireMsgToComposedMsg ¶
func WireMsgToComposedMsg(msgparts [][]byte, signkey []byte) (ComposedMsg, [][]byte, error)
WireMsgToComposedMsg translates a multipart ZMQ messages received from a socket into a ComposedMsg struct and a slice of return identities. This includes verifying the message signature.
type ConnectionInfo ¶
type ConnectionInfo struct { SignatureScheme string `json:"signature_scheme"` Transport string `json:"transport"` StdinPort int `json:"stdin_port"` ControlPort int `json:"control_port"` IOPubPort int `json:"iopub_port"` HBPort int `json:"hb_port"` ShellPort int `json:"shell_port"` Key string `json:"key"` IP string `json:"ip"` }
ConnectionInfo stores the contents of the kernel connection file created by Jupyter.
type Data ¶
type Data struct { Data BundledMIMEData `json:"data"` Metadata BundledMIMEData `json:"metadata"` Transient BundledMIMEData `json:"transient"` }
type Info ¶
type Info struct { ProtocolVersion string `json:"protocol_version"` Implementation string `json:"implementation"` ImplementationVersion string `json:"implementation_version"` LanguageInfo LanguageInfo `json:"language_info"` Banner string `json:"banner"` HelpLinks []HelpLink `json:"help_links"` }
Info holds information about the kubeflow kernel, for kernel_info_reply messages.
type InvalidSignatureError ¶
type InvalidSignatureError struct{}
InvalidSignatureError is returned when the signature on a received message does not validate.
func (*InvalidSignatureError) Error ¶
func (e *InvalidSignatureError) Error() string
type JupyterStreamWriter ¶
type JupyterStreamWriter struct {
// contains filtered or unexported fields
}
JupyterStreamWriter is an `io.Writer` implementation that writes the data to the notebook front-end.
type Kernel ¶
type Kernel struct { // ProtocolVersion defines the Jupyter protocol version. ProtocolVersion string // Version defines the gophernotes version. Version string ConnectionFile string Manager *manager.Manager }
Kernel is a kubeflow kernel.
type LanguageInfo ¶
type LanguageInfo struct { Name string `json:"name"` Version string `json:"version"` MIMEType string `json:"mimetype"` FileExtension string `json:"file_extension"` PygmentsLexer string `json:"pygments_lexer"` CodeMirrorMode string `json:"codemirror_mode"` NBConvertExporter string `json:"nbconvert_exporter"` }
LanguageInfo holds information about the language that this kernel executes code in.
type MsgHeader ¶
type MsgHeader struct { MsgID string `json:"msg_id"` Username string `json:"username"` Session string `json:"session"` MsgType string `json:"msg_type"` ProtocolVersion string `json:"version"` Timestamp string `json:"date"` }
MsgHeader encodes header info for ZMQ messages.