Documentation ¶
Index ¶
- func UnmarshalEvent(data []byte) (interface{}, error)
- func WriteEvent(wr io.Writer, event interface{}) error
- type AbortEvent
- type CapabilitiesEvent
- type ErrorEvent
- type EventReader
- type ExecuteRequest
- type ExecutedEvent
- type InterruptRequest
- type Kernel
- func (k *Kernel) Abort(v ...interface{})
- func (k *Kernel) Err() error
- func (k *Kernel) Eval(src string) (reflect.Value, error)
- func (k *Kernel) Event(event interface{}) bool
- func (k *Kernel) Output() OutputEvent
- func (k *Kernel) Send(event interface{}) error
- func (k *Kernel) SendSafe(event interface{}) bool
- func (k *Kernel) Stderr() io.Writer
- func (k *Kernel) Stdout() io.Writer
- func (k *Kernel) Use(values interp.Exports) error
- type NotebookCapabilities
- type OutputEvent
- type OutputItem
- type Variable
- type VariableRequest
- type VariablesResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnmarshalEvent ¶
func WriteEvent ¶
Types ¶
type AbortEvent ¶
type AbortEvent struct { ID int `json:"id"` Value json.RawMessage `json:"value,omitempty"` Line int `json:"line,omitempty"` Column int `json:"column,omitempty"` Stack string `json:"stack,omitempty"` }
func Abort ¶
func Abort(id int, value ...interface{}) AbortEvent
func (AbortEvent) MarshalJSON ¶
func (e AbortEvent) MarshalJSON() ([]byte, error)
func (AbortEvent) WithLine ¶
func (e AbortEvent) WithLine(line, column int) AbortEvent
func (AbortEvent) WithStack ¶
func (e AbortEvent) WithStack(stack string) AbortEvent
type CapabilitiesEvent ¶
type CapabilitiesEvent struct {
CanProvideVariables bool `json:"canProvideVariables"`
}
func (CapabilitiesEvent) MarshalJSON ¶
func (e CapabilitiesEvent) MarshalJSON() ([]byte, error)
type ErrorEvent ¶
type ErrorEvent struct { ID int `json:"id"` Name string `json:"name,omitempty"` Message string `json:"message,omitempty"` Line int `json:"line,omitempty"` Column int `json:"column,omitempty"` Stack string `json:"stack,omitempty"` }
func Error ¶
func Error(id int, message string) ErrorEvent
func (ErrorEvent) MarshalJSON ¶
func (e ErrorEvent) MarshalJSON() ([]byte, error)
func (ErrorEvent) WithLine ¶
func (e ErrorEvent) WithLine(line, column int) ErrorEvent
func (ErrorEvent) WithName ¶
func (e ErrorEvent) WithName(name string) ErrorEvent
func (ErrorEvent) WithStack ¶
func (e ErrorEvent) WithStack(stack string) ErrorEvent
type EventReader ¶
type EventReader struct {
// contains filtered or unexported fields
}
func NewEventReader ¶
func NewEventReader(rd io.Reader) *EventReader
func (*EventReader) Read ¶
func (e *EventReader) Read() (interface{}, error)
type ExecuteRequest ¶
type ExecutedEvent ¶
type ExecutedEvent struct { ID int `json:"id"` Success bool `json:"success"` Result json.RawMessage `json:"result"` Duration float64 `json:"duration"` ShowResult bool `json:"showResult"` }
func Executed ¶
func Executed(id int, success bool, duration time.Duration, result json.RawMessage, showResult bool) ExecutedEvent
func (ExecutedEvent) MarshalJSON ¶
func (e ExecutedEvent) MarshalJSON() ([]byte, error)
type InterruptRequest ¶
type InterruptRequest struct{}
type Kernel ¶
type Kernel struct { Notebook NotebookCapabilities // contains filtered or unexported fields }
func (*Kernel) Output ¶
func (k *Kernel) Output() OutputEvent
type NotebookCapabilities ¶
type NotebookCapabilities struct {
CanAbort bool
}
type OutputEvent ¶
type OutputEvent struct { ID int `json:"id"` Items []OutputItem `json:"items"` }
func Output ¶
func Output(id int) OutputEvent
func (OutputEvent) Add ¶
func (e OutputEvent) Add(mime string, value []byte) OutputEvent
func (OutputEvent) MarshalJSON ¶
func (e OutputEvent) MarshalJSON() ([]byte, error)
type OutputItem ¶
type VariableRequest ¶
type VariablesResponse ¶
type VariablesResponse struct { ID int `json:"id"` Error string `json:"error,omitempty"` Variables []Variable `json:"variables"` }
func Variables ¶
func Variables(id int, vars []Variable) VariablesResponse
func VariablesError ¶
func VariablesError(id int, err error) VariablesResponse
func (VariablesResponse) MarshalJSON ¶
func (e VariablesResponse) MarshalJSON() ([]byte, error)
func (VariablesResponse) Sort ¶
func (e VariablesResponse) Sort()
Click to show internal directories.
Click to hide internal directories.