stream

package
v2.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BidiReadStream added in v2.1.0

type BidiReadStream[T ReadResponse] interface {
	Receive() (T, error)
}

type BidiReader added in v2.1.0

type BidiReader[T ReadResponse] struct {
	// contains filtered or unexported fields
}

func NewBidiReader added in v2.1.0

func NewBidiReader[T ReadResponse](stream BidiReadStream[T]) *BidiReader[T]

func (*BidiReader[T]) Read added in v2.1.0

func (r *BidiReader[T]) Read(p []byte) (n int, err error)

type ReadResponse

type ReadResponse interface {
	GetBody() []byte
}

type ReadStream

type ReadStream[T ReadResponse] interface {
	Receive() bool
	Msg() T
}

type Reader

type Reader[T ReadResponse] struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader[T ReadResponse](stream ReadStream[T]) *Reader[T]

func (*Reader[T]) Read

func (r *Reader[T]) Read(p []byte) (n int, err error)

type WriteStream

type WriteStream[T any] interface {
	Send(sendRequest T) error
}

type Writer

type Writer[T any] struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter[T any](factory func(body []byte) T, stream WriteStream[T]) *Writer[T]

func (*Writer[T]) Write

func (w *Writer[T]) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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