rettypes

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

func NewReader

func NewReader(r io.Reader) *Reader

NewReader returns a reader that implements io.Reader with rate limiting.

func NewReaderWithContext

func NewReaderWithContext(r io.Reader, ctx context.Context) *Reader

NewReaderWithContext returns a reader that implements io.Reader with rate limiting.

func (*Reader) Read

func (s *Reader) Read(p []byte) (int, error)

Read reads bytes into p.

func (*Reader) SetRateLimit

func (s *Reader) SetRateLimit(bytesPerSec float64)

SetRateLimit sets rate limit (bytes/sec) to the reader.

type Stream

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

func NewStream

func NewStream(io io.Reader) *Stream

func (*Stream) AddHeader

func (s *Stream) AddHeader(k, v string)

func (*Stream) Append

func (s *Stream) Append(header def.ReadHeader) map[string]string

func (*Stream) Close

func (s *Stream) Close() error

func (*Stream) Code

func (s *Stream) Code() int

func (*Stream) ContentType

func (s *Stream) ContentType() string

func (*Stream) Read

func (s *Stream) Read(p []byte) (n int, err error)

Read(p []byte) (n int, err error)

func (*Stream) Register

func (s *Stream) Register() []reflect.Type

func (*Stream) Return

func (s *Stream) Return() io.Reader

func (*Stream) SetContentType

func (s *Stream) SetContentType(conTyp string)

func (*Stream) SetName added in v0.0.5

func (s *Stream) SetName(name string)

func (*Stream) SetRateLimit

func (s *Stream) SetRateLimit(bytesPerSec float64)

func (*Stream) Strings

func (s *Stream) Strings() string

type Writer

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

func NewWriter

func NewWriter(w io.Writer) *Writer

NewWriter returns a writer that implements io.Writer with rate limiting.

func NewWriterWithContext

func NewWriterWithContext(w io.Writer, ctx context.Context) *Writer

NewWriterWithContext returns a writer that implements io.Writer with rate limiting.

func (*Writer) SetRateLimit

func (s *Writer) SetRateLimit(bytesPerSec float64)

SetRateLimit sets rate limit (bytes/sec) to the writer.

func (*Writer) Write

func (s *Writer) Write(p []byte) (int, error)

Write writes bytes from p.

Jump to

Keyboard shortcuts

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