httpcommon

package module
v0.0.0-...-d04a3f7 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2019 License: MIT Imports: 4 Imported by: 1

README

http-common

Golang net/http common types

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIsDir  = errors.New("is directory")
	ErrIsFile = errors.New("is file")
)

Functions

This section is empty.

Types

type Dir

type Dir struct {
	Name   string
	Reader func(count int) (items []os.FileInfo, err error)
}

func NewDir

func NewDir(name string, reader func(count int) (items []os.FileInfo, err error)) *Dir

func (*Dir) Close

func (f *Dir) Close() error

func (*Dir) Read

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

func (*Dir) Readdir

func (f *Dir) Readdir(count int) (items []os.FileInfo, err error)

func (*Dir) Seek

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

func (*Dir) Stat

func (f *Dir) Stat() (os.FileInfo, error)

type File

type File struct {
	FileInfo os.FileInfo
	// contains filtered or unexported fields
}

func NewFile

func NewFile(info os.FileInfo, open func() (iocommon.ReadSeekCloser, error)) *File

func (*File) Close

func (f *File) Close() error

func (*File) Read

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

func (*File) Readdir

func (f *File) Readdir(count int) ([]os.FileInfo, error)

func (*File) Seek

func (f *File) Seek(offset int64, whence int) (n int64, err error)

func (*File) Stat

func (f *File) Stat() (os.FileInfo, error)

Jump to

Keyboard shortcuts

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