Documentation
¶
Index ¶
Constants ¶
View Source
const ( ErrCodeParse = -32700 ErrCodeInvalidRequest = -32600 ErrCodeMethodNotFound = -32601 ErrCodeInvalidParams = -32602 ErrCodeInternal = -32603 ErrCodeVMFailed = -32000 ErrCodeExecFailed = -32001 ErrCodeFileFailed = -32002 ErrCodeCancelled = -32003 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Request ¶
type Request struct {
JSONRPC string `json:"jsonrpc"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
ID *uint64 `json:"id,omitempty"`
}
type VM ¶
type VM interface {
ID() string
Config() *api.Config
Start(ctx context.Context) error
Stop(ctx context.Context) error
Exec(ctx context.Context, command string, opts *api.ExecOptions) (*api.ExecResult, error)
WriteFile(ctx context.Context, path string, content []byte, mode uint32) error
ReadFile(ctx context.Context, path string) ([]byte, error)
ListFiles(ctx context.Context, path string) ([]api.FileInfo, error)
AddAllowedHosts(ctx context.Context, hosts []string) ([]string, error)
RemoveAllowedHosts(ctx context.Context, hosts []string) ([]string, error)
AllowedHosts(ctx context.Context) ([]string, error)
Events() <-chan api.Event
Close(ctx context.Context) error
}
Click to show internal directories.
Click to hide internal directories.