Documentation ¶
Overview ¶
Package gioutil provides wrappers around certain GIO classes to be more Go idiomatic.
Index ¶
- func InputCloser(ctx context.Context, input gio.InputStreamer) io.Closer
- func NewInputStream(r io.Reader) *gio.InputStream
- func NewOutputStream(w io.Writer) *gio.OutputStream
- func OutputCloser(ctx context.Context, output gio.OutputStreamer) io.Closer
- func PixbufLoaderWriter(l *gdkpixbuf.PixbufLoader) io.WriteCloser
- func ReadCloser(r io.Reader, c io.Closer) io.ReadCloser
- func Seeker(ctx context.Context, s gio.Seekabler) io.Seeker
- type StreamReader
- type StreamWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InputCloser ¶
InputCloser wraps an InputStreamer and returns an io.Closer.
func NewInputStream ¶
NewInputStream creates a new InputStream for the given io.Reader. If r implements io.Closer, then it is automatically called if needed.
func NewOutputStream ¶
NewOutputStream creates a new OutputStream for the given io.Reader. If r implements io.Closer, then it is automatically called if needed.
func OutputCloser ¶
OutputCloser wraps an OutputStreamer and returns an io.Closer.
func PixbufLoaderWriter ¶
func PixbufLoaderWriter(l *gdkpixbuf.PixbufLoader) io.WriteCloser
PixbufLoaderWriter wraps a PixbufLoader to satsify io.WriteCloser.
func ReadCloser ¶
ReadCloser combines the reader and closer together.
Types ¶
type StreamReader ¶
type StreamReader struct {
// contains filtered or unexported fields
}
StreamReader wraps around a gio.InputStreamer.
func Reader ¶
func Reader(ctx context.Context, s gio.InputStreamer) *StreamReader
Reader wraps a gio.InputStreamer to provide an io.ReadCloser. The given context allows the caller to cancel all ongoing operations done on the new ReadCloser.
type StreamWriter ¶
type StreamWriter struct {
// contains filtered or unexported fields
}
StreamWriter wraps around a gio.OutputStreamer.
func Writer ¶
func Writer(ctx context.Context, s gio.OutputStreamer) *StreamWriter
Writer wraps a gio.OutputStreamer to provide an io.WriteCloser with flushing capability.
func (*StreamWriter) Flush ¶
func (w *StreamWriter) Flush() error
Flush flushes the writer. See gio.OutputStreamer.Flush.