dagger

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package dagger is the first attempt at an API for webassembly modules to communicate with the outside world. It is based on the idea of files being used as the intermediate between user modules and resources.

Consider this the first draft of Dagger, everything here is subject to change. This is going to be the experimental phase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Errno

type Errno int

Errno is the error number for an error.

const (
	ErrorNone Errno = iota
	ErrorBadURL
	ErrorBadURLInput
	ErrorUnknownScheme
)

Error numbers

func (Errno) String

func (i Errno) String() string

type Error

type Error struct {
	Errno      Errno
	Underlying error
}

Error is a common error type for dagger operations.

func (Error) Error

func (e Error) Error() string

type Process

type Process struct {
	// contains filtered or unexported fields
}

Process is a higher level wrapper around a set of files for dagger modules.

func NewProcess

func NewProcess(name string) *Process

NewProcess creates a new process.

func (*Process) CloseFD

func (p *Process) CloseFD(fd int64) int64

CloseFD closes a file descriptor.

func (Process) Files

func (p Process) Files() []abi.File

Files returns the process' list of open files.

func (*Process) Name

func (p *Process) Name() string

Name returns this process's name.

func (*Process) Open

func (p *Process) Open(f abi.File)

Open makes this Process track an arbitrary extra file.

func (*Process) OpenFD

func (p *Process) OpenFD(furl string, flags uint32) int64

OpenFD opens a file descriptor for this Process with the given file url string and flags integer.

func (*Process) ReadFD

func (p *Process) ReadFD(fd int64, buf []byte) int64

ReadFD reads data from the given FD into the byte buffer.

func (*Process) ResolveFunc

func (p *Process) ResolveFunc(module, field string) exec.FunctionImport

ResolveFunc resolves dagger's ABI and importable functions.

func (*Process) ResolveGlobal

func (p *Process) ResolveGlobal(module, field string) int64

ResolveGlobal does nothing, currently.

func (*Process) SyncFD

func (p *Process) SyncFD(fd int64) int64

SyncFD runs a file's sync operation and returns -1 if it failed.

func (*Process) WriteFD

func (p *Process) WriteFD(fd int64, data []byte) int64

WriteFD writes the given data to a file descriptor, returning -1 if it failed somehow.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL