httpio

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRangeUnsupported = errors.New("range unsupported")
)

Functions

This section is empty.

Types

type Option added in v0.11.0

type Option func(*option)

func Limit added in v0.11.0

func Limit(n int64) Option

func Offset added in v0.11.0

func Offset(offset int64) Option

func Retry added in v0.11.0

func Retry(retry int) Option

func WithHTTPOptions added in v0.11.0

func WithHTTPOptions(opts ...httpc.Option) Option

type Reader

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

func NewReader added in v0.11.0

func NewReader(ctx context.Context, timeout time.Duration, url string, opts ...Option) *Reader

func (*Reader) Close

func (r *Reader) Close() error

func (*Reader) Len added in v0.11.0

func (r *Reader) Len() int64

Len returns content length need read, -1 means unknown.

func (*Reader) Offset added in v0.11.0

func (r *Reader) Offset() int64

Offset is current offset of read.

func (*Reader) Read

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

func (*Reader) ReadAt added in v0.11.0

func (r *Reader) ReadAt(p []byte, offset int64) (int, error)

func (*Reader) Size added in v0.11.0

func (r *Reader) Size() int64

func (*Reader) WriteTo

func (r *Reader) WriteTo(w io.Writer) (int64, error)

Jump to

Keyboard shortcuts

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