Documentation
¶
Overview ¶
Package cwa contains the ABI for CommonWA1 applications.
Index ¶
- Constants
- func ErrorCode(err error) int
- type Error
- type Process
- func (p *Process) ArgAt(i int32, outPtr, outLen uint32) (int32, error)
- func (p *Process) ArgLen() int32
- func (p *Process) EnvGet(keyPtr, keyLen, valPtr, valLen uint32) (int32, error)
- func (p *Process) Files() []abi.File
- func (p *Process) IOGetStderr() int32
- func (p *Process) IOGetStdin() int32
- func (p *Process) IOGetStdout() int32
- func (p *Process) LogWrite(level int32, msgPtr, msgLen uint32)
- func (p *Process) Name() string
- func (Process) Open(abi.File)
- func (p *Process) RandI32() int32
- func (p *Process) RandI64() int64
- func (p *Process) ResolveFunc(module, field string) exec.FunctionImport
- func (p *Process) ResolveGlobal(module, field string) int64
- func (p *Process) ResourceClose(fid int32) error
- func (p *Process) ResourceFlush(fid int32) error
- func (p *Process) ResourceOpen(urlPtr, urlLen uint32) (int32, error)
- func (p *Process) ResourceRead(fid int32, dataPtr, dataLen uint32) (int32, error)
- func (p *Process) ResourceWrite(fid int32, dataPtr, dataLen uint32) (int32, error)
- func (p *Process) RuntimeName(namePtr, nameLen uint32) int32
- func (p *Process) SetVM(vm *exec.VirtualMachine)
- func (p *Process) Setenv(m map[string]string)
- func (p Process) SyscallCount() int64
- func (p *Process) TimeNow() int64
Constants ¶
const ( LogLevelError = 1 LogLevelWarning = 3 LogLevelInfo = 6 )
Log levels
const ( SpecMajor = 0 SpecMinor = 1 RuntimeName = "olin" )
Constants
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
type Error int
Error is an individual error as defined by the CommonWA spec.
const ( ErrNone Error = (iota * -1) UnknownError InvalidArgumentError PermissionDeniedError NotFoundError EndOfFileError )
CommonWA errors as defined by the spec at https://github.com/CommonWA/cwa-spec/blob/master/errors.md
type Process ¶
type Process struct { HC *http.Client Logger *log.Logger Policy *policy.Policy FileHandles map[int32]abi.File Stdin io.Reader Stdout, Stderr io.Writer // contains filtered or unexported fields }
Process is an individual CommonWA process. It is the collection of resources and other macguffins that the child module ends up requiring.
func NewProcess ¶
NewProcess creates a new process with the given name, arguments and environment.
func (*Process) IOGetStderr ¶
func (*Process) IOGetStdin ¶
func (*Process) IOGetStdout ¶
func (*Process) ResolveFunc ¶
func (p *Process) ResolveFunc(module, field string) exec.FunctionImport
ResolveFunc resolves the CommonWA ABI and importable functions.
func (*Process) ResolveGlobal ¶
ResolveGlobal does nothing, currently.
func (*Process) ResourceClose ¶
func (*Process) ResourceFlush ¶
func (*Process) ResourceRead ¶
func (*Process) ResourceWrite ¶
func (*Process) RuntimeName ¶
func (*Process) SetVM ¶
func (p *Process) SetVM(vm *exec.VirtualMachine)
SetVM sets the VM associated with this process.
func (*Process) Setenv ¶
Setenv updates a process' environment. This does not inform the process. It is up to the running process to detect these values have changed.