iobindings

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: Apache-2.0 Imports: 11 Imported by: 12

Documentation

Index

Constants

View Source
const NilTimeout = time.Duration(-1)

NilTimeout is the nil-valued timeout.

Variables

This section is empty.

Functions

func Close

func Close(_ *rt.Thread, c *rt.GoCont) (rt.Cont, *rt.Error)

Close TODO

func CloseWithCloser

func CloseWithCloser(cl io.Closer, c *rt.GoCont) (rt.Cont, *rt.Error)

CloseWithCloser TODO

func CloserArg

func CloserArg(c *rt.GoCont, n int) (io.Closer, *rt.Error)

CloserArg turns a continuation argument into an io.Closer.

func Flush

func Flush(_ *rt.Thread, c *rt.GoCont) (rt.Cont, *rt.Error)

Flush TODO

Note that Flush will fallback to calling the Sync method if the argument does not support Flusher but does support Syncer.

func FlushWithFlusher

func FlushWithFlusher(w Flusher, c *rt.GoCont) (rt.Cont, *rt.Error)

FlushWithFlusher TODO

func GetTimeout

func GetTimeout(_ *rt.Thread, c *rt.GoCont) (rt.Cont, *rt.Error)

GetTimeout returns the current I/O timeout, in seconds. A nil timeout value allows operations to block indefinitely. Args: gettimeouter

func GetTimeoutWithGetTimeouter

func GetTimeoutWithGetTimeouter(s GetTimeouter, c *rt.GoCont) (rt.Cont, *rt.Error)

GetTimeoutWithGetTimeouter returns the current I/O timeout, in seconds. A nil timeout value allows operations to block indefinitely. Args:

func IsClosed

func IsClosed(_ *rt.Thread, c *rt.GoCont) (rt.Cont, *rt.Error)

IsClosed TODO

func Lines

func Lines(_ *rt.Thread, c *rt.GoCont) (rt.Cont, *rt.Error)

Lines TODO

func LinesWithReader

func LinesWithReader(r io.Reader, c *rt.GoCont, closeAtEOF bool) (rt.Cont, *rt.Error)

LinesWithReader TODO

func PushingError

func PushingError(c *rt.GoCont, err error) (rt.Cont, *rt.Error)

PushingError TODO

func PushingNextResult

func PushingNextResult(c *rt.GoCont, v rt.Value, err error) (rt.Cont, *rt.Error)

PushingNextResult TODO

func Read

func Read(t *rt.Thread, c *rt.GoCont) (rt.Cont, *rt.Error)

Read TODO

func ReadAll

func ReadAll(r io.Reader, t *rt.Thread) (string, error)

ReadAll reads from r until an error, EOF, or the interrupt channel on t fires, and returns the data it read. A successful call returns err == nil, not err == EOF. Because ReadAll is defined to read from src until EOF, it does not treat an EOF from Read as an error to be reported.

func ReadCloserArg

func ReadCloserArg(c *rt.GoCont, n int) (io.ReadCloser, *rt.Error)

ReadCloserArg turns a continuation argument into an io.ReadCloser.

func ReadWithReader

func ReadWithReader(r io.Reader, t *rt.Thread, c *rt.GoCont) (rt.Cont, *rt.Error)

ReadWithReader TODO

func ReadWriteCloserArg

func ReadWriteCloserArg(c *rt.GoCont, n int) (io.ReadWriteCloser, *rt.Error)

ReadWriteCloserArg turns a continuation argument into an io.ReadWriteCloser.

func ReadWriterArg

func ReadWriterArg(c *rt.GoCont, n int) (io.ReadWriter, *rt.Error)

ReadWriterArg turns a continuation argument into an io.ReadWriter.

func ReaderArg

func ReaderArg(c *rt.GoCont, n int) (io.Reader, *rt.Error)

ReaderArg turns a continuation argument into an io.Reader.

func Seek

func Seek(_ *rt.Thread, c *rt.GoCont) (rt.Cont, *rt.Error)

Seek TODO

func SeekerArg

func SeekerArg(c *rt.GoCont, n int) (io.Seeker, *rt.Error)

SeekerArg turns a continuation argument into an io.Seeker.

func SetTimeout

func SetTimeout(_ *rt.Thread, c *rt.GoCont) (rt.Cont, *rt.Error)

SetTimeout sets the timeout, defining a limit on the amount of time the I/O methods can block. When a timeout is set and the specified amount of time has elapsed, the affected methods give up and fail with an error message. The amount of time to wait is specified as the value parameter, in seconds.

The nil timeout value allows operations to block indefinitely. Negative timeout values have the same effect. Args: settimeouter [value]

func SetTimeoutWithSetTimeouter

func SetTimeoutWithSetTimeouter(s SetTimeouter, c *rt.GoCont) (rt.Cont, *rt.Error)

SetTimeoutWithSetTimeouter sets the timeout, defining a limit on the amount of time the I/O methods can block. When a timeout is set and the specified amount of time has elapsed, the affected methods give up and fail with an error message. The amount of time to wait is specified as the value parameter, in seconds.

The nil timeout value allows operations to block indefinitely. Negative timeout values have the same effect. Args: [value]

func StringerArg

func StringerArg(c *rt.GoCont, n int) (fmt.Stringer, *rt.Error)

StringerArg turns a continuation argument into a fmt.Stringer.

func SyncWithSyncer

func SyncWithSyncer(w Syncer, c *rt.GoCont) (rt.Cont, *rt.Error)

SyncWithSyncer TODO

func ToString

func ToString(_ *rt.Thread, c *rt.GoCont) (rt.Cont, *rt.Error)

ToString TODO

func ValueToCloser

func ValueToCloser(v rt.Value) (io.Closer, bool)

ValueToCloser turns a Lua value to an io.Closer, if possible.

func ValueToReadCloser

func ValueToReadCloser(v rt.Value) (io.ReadCloser, bool)

ValueToReadCloser turns a Lua value to an io.ReadCloser, if possible.

func ValueToReadWriteCloser

func ValueToReadWriteCloser(v rt.Value) (io.ReadWriteCloser, bool)

ValueToReadWriteCloser turns a Lua value to an io.ReadWriteCloser, if possible.

func ValueToReadWriter

func ValueToReadWriter(v rt.Value) (io.ReadWriter, bool)

ValueToReadWriter turns a Lua value to an io.ReadWriter, if possible.

func ValueToReader

func ValueToReader(v rt.Value) (io.Reader, bool)

ValueToReader turns a Lua value to an io.Reader, if possible.

func ValueToSeeker

func ValueToSeeker(v rt.Value) (io.Seeker, bool)

ValueToSeeker turns a Lua value to an io.Seeker, if possible.

func ValueToStringer

func ValueToStringer(v rt.Value) (fmt.Stringer, bool)

ValueToStringer turns a Lua value to a fmt.Stringer, if possible.

func ValueToWriteCloser

func ValueToWriteCloser(v rt.Value) (io.WriteCloser, bool)

ValueToWriteCloser turns a Lua value to an io.WriteCloser, if possible.

func ValueToWriter

func ValueToWriter(v rt.Value) (io.Writer, bool)

ValueToWriter turns a Lua value to an io.Writer, if possible.

func Write

func Write(_ *rt.Thread, c *rt.GoCont) (rt.Cont, *rt.Error)

Write TODO

func WriteCloserArg

func WriteCloserArg(c *rt.GoCont, n int) (io.WriteCloser, *rt.Error)

WriteCloserArg turns a continuation argument into an io.WriteCloser.

func WriteValues

func WriteValues(w io.Writer, vals []rt.Value) error

WriteValues writes the given values to w.

func WriteWithWriter

func WriteWithWriter(v rt.Value, c *rt.GoCont) (rt.Cont, *rt.Error)

WriteWithWriter TODO

func WriterArg

func WriterArg(c *rt.GoCont, n int) (io.Writer, *rt.Error)

WriterArg turns a continuation argument into an io.Writer.

Types

type Flusher

type Flusher interface {
	Flush() error
}

Flusher is the interface satisfied by the Flush method.

func FlusherArg

func FlusherArg(c *rt.GoCont, n int) (Flusher, *rt.Error)

FlusherArg turns a continuation argument into a Flusher.

func ValueToFlusher

func ValueToFlusher(v rt.Value) (Flusher, bool)

ValueToFlusher turns a Lua value to a Flusher, if possible.

type GetTimeouter

type GetTimeouter interface {
	GetTimeout() time.Duration
}

GetTimeouter is the interface satisfied by the GetTimeout method.

func GetTimeouterArg

func GetTimeouterArg(c *rt.GoCont, n int) (GetTimeouter, *rt.Error)

GetTimeouterArg turns a continuation argument into a GetTimeouter.

func ValueToGetTimeouter

func ValueToGetTimeouter(v rt.Value) (GetTimeouter, bool)

ValueToGetTimeouter turns a Lua value to a GetTimeouter, if possible.

type IsCloseder

type IsCloseder interface {
	IsClosed() bool
}

IsCloseder is the interface satisfied by the IsClosed method.

func IsClosederArg

func IsClosederArg(c *rt.GoCont, n int) (IsCloseder, *rt.Error)

IsClosederArg turns a continuation argument into an IsCloseder.

func ValueToIsCloseder

func ValueToIsCloseder(v rt.Value) (IsCloseder, bool)

ValueToIsCloseder turns a Lua value to an IsCloseder, if possible.

type SetTimeouter

type SetTimeouter interface {
	SetTimeout(time.Duration)
}

SetTimeouter is the interface satisfied by the SetTimeout method.

func SetTimeouterArg

func SetTimeouterArg(c *rt.GoCont, n int) (SetTimeouter, *rt.Error)

SetTimeouterArg turns a continuation argument into a SetTimeouter.

func ValueToSetTimeouter

func ValueToSetTimeouter(v rt.Value) (SetTimeouter, bool)

ValueToSetTimeouter turns a Lua value to a SetTimeouter, if possible.

type Syncer

type Syncer interface {
	Sync() error
}

Syncer is the interface satisfied by the Sync method.

func SyncerArg

func SyncerArg(c *rt.GoCont, n int) (Syncer, *rt.Error)

SyncerArg turns a continuation argument into a Syncer.

func ValueToSyncer

func ValueToSyncer(v rt.Value) (Syncer, bool)

ValueToSyncer turns a Lua value to a Syncer, if possible.

Jump to

Keyboard shortcuts

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