iobindings

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: Apache-2.0, MIT Imports: 10 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, error)

Close TODO

func CloseWithCloser

func CloseWithCloser(cl io.Closer, c rt.Cont) (rt.Cont, error)

CloseWithCloser TODO

func CloserArg

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

CloserArg turns a continuation argument into an io.Closer.

func Flush

func Flush(_ *rt.Thread, c *rt.GoCont) (rt.Cont, 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.Cont) (rt.Cont, error)

FlushWithFlusher TODO

func GetTimeout

func GetTimeout(_ *rt.Thread, c *rt.GoCont) (rt.Cont, 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.Cont) (rt.Cont, 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, error)

IsClosed TODO

func Lines

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

Lines TODO

func LinesWithReader

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

LinesWithReader TODO

func PushingError

func PushingError(c rt.Cont, err error) (rt.Cont, error)

PushingError TODO

func PushingNextResult

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

PushingNextResult TODO

func Read

func Read(t *rt.Thread, c *rt.GoCont) (rt.Cont, 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, 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, error)

ReadWithReader TODO

func ReadWriteCloserArg

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

ReadWriteCloserArg turns a continuation argument into an io.ReadWriteCloser.

func ReadWriterArg

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

ReadWriterArg turns a continuation argument into an io.ReadWriter.

func ReaderArg

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

ReaderArg turns a continuation argument into an io.Reader.

func Seek

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

Seek TODO

func SeekerArg

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

SeekerArg turns a continuation argument into an io.Seeker.

func SetTimeout

func SetTimeout(_ *rt.Thread, c *rt.GoCont) (rt.Cont, 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, 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, error)

StringerArg turns a continuation argument into a fmt.Stringer.

func SyncWithSyncer

func SyncWithSyncer(w Syncer, c rt.Cont) (rt.Cont, error)

SyncWithSyncer TODO

func ToString

func ToString(_ *rt.Thread, c *rt.GoCont) (rt.Cont, 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, error)

Write TODO

func WriteCloserArg

func WriteCloserArg(c *rt.GoCont, n int) (io.WriteCloser, 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, error)

WriteWithWriter TODO

func WriterArg

func WriterArg(c *rt.GoCont, n int) (io.Writer, 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, 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, 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, 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, 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, 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