Versions in this module Expand all Collapse all v0 v0.1.0 Oct 29, 2026 Changes in this version + var ErrClosed = errors.New("monty handle is closed") + var ErrConcurrentUse = errors.New("monty handle is already in use") + func LoadReplSnapshot(data []byte) (Progress, *Repl, error) + type Call struct + Args []Value + CallID uint32 + FunctionName string + IsMethodCall bool + Kwargs Dict + ObjectID string + type CompileOptions struct + Inputs []string + ScriptName string + TypeCheck bool + TypeCheckStubs string + type Complete struct + IsRepl bool + Output Value + ScriptName string + type Dataclass struct + Attrs Dict + ClassID string + FieldNames []string + Frozen bool + InstanceID string + Methods map[string]MethodHandler + Name string + PlainClass bool + SandboxClass bool + TypeID uint64 + type Date struct + Day uint8 + Month uint8 + Year int32 + type DateTime struct + Day uint8 + Hour uint8 + Microsecond uint32 + Minute uint8 + Month uint8 + OffsetSeconds *int32 + Second uint8 + TimezoneName *string + Year int32 + type Dict []Pair + type Exception struct + Arg *string + Type string + func (e Exception) Error() string + func (e Exception) FromError(err error) Exception + type ExternalFunction func(context.Context, Call) (Result, error) + type FeedOptions struct + Functions map[string]ExternalFunction + Inputs map[string]Value + Mounts []*MountDir + OS OSHandler + Print PrintCallback + type FeedStartOptions struct + Inputs map[string]Value + type Frame struct + Column uint32 + EndColumn uint32 + EndLine uint32 + Filename string + FunctionName *string + Line uint32 + SourceLine *string + type FrozenSet []Value + type Function struct + Docstring *string + Name string + type FutureSnapshot struct + func (s *FutureSnapshot) Dump() ([]byte, error) + func (s *FutureSnapshot) PendingCallIDs() []uint32 + func (s *FutureSnapshot) ResumeResults(ctx context.Context, results map[uint32]Result) (Progress, error) + type MethodHandler = ExternalFunction + type MountDir struct + func NewMountDir(virtualPath string, hostPath string, opts MountDirOptions) (*MountDir, error) + func (m *MountDir) Close() error + func (m *MountDir) HostPath() string + func (m *MountDir) Mode() MountMode + func (m *MountDir) VirtualPath() string + type MountDirOptions struct + Mode MountMode + WriteBytesLimit *uint64 + type MountMode string + const MountOverlay + const MountReadOnly + const MountReadWrite + type NameLookupSnapshot struct + VariableName string + func (s *NameLookupSnapshot) Dump() ([]byte, error) + func (s *NameLookupSnapshot) ResumeUndefined(ctx context.Context) (Progress, error) + func (s *NameLookupSnapshot) ResumeValue(ctx context.Context, value Value) (Progress, error) + type NamedTuple struct + FieldNames []string + TypeName string + Values []Value + type OSCall struct + Args []Value + CallID uint32 + Function OSFunction + Kwargs Dict + type OSFunction string + const OSDateTimeNow + const OSDateToday + const OSGetEnviron + const OSGetenv + const OSImport + const OSImportStubs + const OSOpen + const OSPathAbsolute + const OSPathAppendBytes + const OSPathAppendText + const OSPathExists + const OSPathIsDir + const OSPathIsFile + const OSPathIsSymlink + const OSPathIterdir + const OSPathMkdir + const OSPathReadBytes + const OSPathReadText + const OSPathRename + const OSPathResolve + const OSPathRmdir + const OSPathScan + const OSPathStat + const OSPathUnlink + const OSPathWriteBytes + const OSPathWriteText + const OSSystemAsyncSleep + const OSSystemSleep + const OSTime + const OSUrandom + type OSHandler func(context.Context, OSCall) (Result, error) + type Pair struct + Key Value + Value Value + type Path string + type PrintCallback func(stream string, text string) + func WriterPrintCallback(w io.Writer) PrintCallback + type Progress interface + func LoadSnapshot(data []byte) (Progress, error) + type Repl struct + func LoadRepl(data []byte) (*Repl, error) + func NewRepl(opts ReplOptions) (*Repl, error) + func (r *Repl) Close() error + func (r *Repl) Dump() ([]byte, error) + func (r *Repl) FeedRun(ctx context.Context, code string, opts FeedOptions) (Value, error) + func (r *Repl) FeedStart(ctx context.Context, code string, opts FeedStartOptions) (Progress, error) + type ReplOptions struct + Cwd string + Limits *ResourceLimits + ScriptName string + type ResourceLimits struct + GCInterval int + MaxAllocations int + MaxDuration time.Duration + MaxMemory int + MaxRecursionDepth int + type Result struct + func Pending(waiter Waiter) Result + func Raise(exception Exception) Result + func Return(value Value) Result + func (r Result) IsPending() bool + func (r Result) Raised() (*Exception, bool) + func (r Result) Value() Value + func (r Result) Waiter() Waiter + type RunOptions struct + Cwd string + Functions map[string]ExternalFunction + Inputs map[string]Value + Limits *ResourceLimits + Mounts []*MountDir + OS OSHandler + Print PrintCallback + type Runner struct + func LoadRunner(data []byte) (*Runner, error) + func New(code string, opts CompileOptions) (*Runner, error) + func (r *Runner) Close() error + func (r *Runner) Dump() ([]byte, error) + func (r *Runner) Run(ctx context.Context, opts RunOptions) (Value, error) + func (r *Runner) Start(ctx context.Context, opts StartOptions) (Progress, error) + func (r *Runner) TypeCheck(prefix string) error + type RuntimeError struct + Frames []Frame + func (e *RuntimeError) Error() string + func (e *RuntimeError) TracebackString() string + type Set []Value + type Snapshot struct + Args []Value + CallID uint32 + FunctionName string + IsMethodCall bool + IsOSFunction bool + Kwargs Dict + ObjectID string + func (s *Snapshot) Dump() ([]byte, error) + func (s *Snapshot) ResumeException(ctx context.Context, exception Exception) (Progress, error) + func (s *Snapshot) ResumePending(ctx context.Context) (Progress, error) + func (s *Snapshot) ResumeReturn(ctx context.Context, value Value) (Progress, error) + type StartOptions struct + Cwd string + Inputs map[string]Value + Limits *ResourceLimits + type StatResult struct + Atime float64 + Ctime float64 + Dev int64 + GID int64 + Ino int64 + Mode int64 + Mtime float64 + Nlink int64 + Size int64 + UID int64 + type SyntaxError struct + Frames []Frame + func (e *SyntaxError) Error() string + func (e *SyntaxError) TracebackString() string + type TimeDelta struct + Days int32 + Microseconds int32 + Seconds int32 + type TimeZone struct + Name *string + OffsetSeconds int32 + type Tuple []Value + type TypingError struct + func (e *TypingError) Display(format string, color bool) string + func (e *TypingError) Error() string + func (e *TypingError) TracebackString() string + type Value struct + func BigInt(value *big.Int) Value + func Bool(value bool) Value + func Bytes(value []byte) Value + func CycleValue(value string) Value + func DataclassValue(value Dataclass) Value + func DateTimeValue(dt DateTime) Value + func DateValue(date Date) Value + func DictValue(items Dict) Value + func Ellipsis() Value + func ExceptionValue(exception Exception) Value + func Float(value float64) Value + func FrozenSetValue(items FrozenSet) Value + func FunctionValue(function Function) Value + func Int(value int64) Value + func List(items ...Value) Value + func MustValueOf(value any) Value + func NamedTupleValue(value NamedTuple) Value + func None() Value + func PathValue(path Path) Value + func ReprValue(value string) Value + func SetValue(items Set) Value + func String(value string) Value + func TimeDeltaValue(td TimeDelta) Value + func TimeZoneValue(tz TimeZone) Value + func TupleValue(items ...Value) Value + func ValueOf(value any) (Value, error) + func (v *Value) UnmarshalJSON(data []byte) error + func (v Value) Dataclass() (Dataclass, bool) + func (v Value) Date() (Date, bool) + func (v Value) DateTime() (DateTime, bool) + func (v Value) Exception() (Exception, bool) + func (v Value) Function() (Function, bool) + func (v Value) Kind() ValueKind + func (v Value) MarshalJSON() ([]byte, error) + func (v Value) Raw() any + func (v Value) StatResult() (StatResult, bool) + func (v Value) String() string + func (v Value) TimeDelta() (TimeDelta, bool) + func (v Value) TimeZone() (TimeZone, bool) + type ValueKind string + type Waiter interface + Wait func(context.Context) Result