zhttp

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRangeSupport       = errors.New("remote server doesn't support seeking")
	ErrUnsupportedRangeType = errors.New("unsupported range type")
	ErrNegativeSeek         = errors.New("cannot seek below 0")
	ErrExceededLength       = errors.New("exceeded content size")
	ErrNoWrite              = errors.New("unable to write to http server")
)

Functions

This section is empty.

Types

type HttpFile

type HttpFile struct {
	Url       string
	Requests  uint64
	ReadBytes uint64

	ContentType  string
	ContentSize  int64
	RangeSupport bool
	ModTime      time.Time

	io.ReadSeekCloser
	io.ReaderAt
	// contains filtered or unexported fields
}

func NewHttpFile

func NewHttpFile(url string) *HttpFile

func (*HttpFile) Close

func (f *HttpFile) Close() error

func (*HttpFile) Name

func (f *HttpFile) Name() string

func (*HttpFile) Open

func (f *HttpFile) Open() (err error)

func (*HttpFile) Read

func (f *HttpFile) Read(p []byte) (n int, err error)

func (*HttpFile) ReadAt

func (f *HttpFile) ReadAt(p []byte, offset int64) (n int, err error)

func (*HttpFile) Readdir

func (f *HttpFile) Readdir(count int) ([]fs.FileInfo, error)

func (*HttpFile) Readdirnames

func (f *HttpFile) Readdirnames(count int) ([]string, error)

func (*HttpFile) Seek

func (f *HttpFile) Seek(offset int64, whence int) (int64, error)

func (*HttpFile) SetClient

func (f *HttpFile) SetClient(client *http.Client)

func (*HttpFile) Stat

func (f *HttpFile) Stat() (fs.FileInfo, error)

func (*HttpFile) Sync

func (f *HttpFile) Sync() error

func (*HttpFile) Truncate

func (f *HttpFile) Truncate(size int64) error

func (*HttpFile) Write

func (f *HttpFile) Write(p []byte) (int, error)

All write methods unavailable

func (*HttpFile) WriteAt

func (f *HttpFile) WriteAt(p []byte, offset int64) (int, error)

func (*HttpFile) WriteString

func (f *HttpFile) WriteString(str string) (int, error)

type HttpFileInfo

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

func (*HttpFileInfo) IsDir

func (f *HttpFileInfo) IsDir() bool

func (*HttpFileInfo) ModTime

func (f *HttpFileInfo) ModTime() time.Time

func (*HttpFileInfo) Mode

func (f *HttpFileInfo) Mode() fs.FileMode

func (*HttpFileInfo) Name

func (f *HttpFileInfo) Name() string

func (*HttpFileInfo) Size

func (f *HttpFileInfo) Size() int64

func (*HttpFileInfo) Sys

func (f *HttpFileInfo) Sys() interface{}

type Range

type Range struct {
	Start int
	End   int
	Total int
}

Jump to

Keyboard shortcuts

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