files

package
v0.0.0-...-6d3478e Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2018 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 DodFile

type DodFile struct {
	Reader *bytes.Reader
	Info   os.FileInfo
	Dirs   []os.FileInfo
}

DodFile defines a standin structure for a giving http.File object.

func New

func New(name string, size int64, body *bytes.Reader, dirs ...os.FileInfo) *DodFile

New returns a new DodFile instance.

func (DodFile) Close

func (d DodFile) Close() error

Close returns nil always.

func (*DodFile) Read

func (d *DodFile) Read(b []byte) (int, error)

Read reads data into the byte slice.

func (DodFile) Readdir

func (d DodFile) Readdir(dm int) ([]os.FileInfo, error)

Readdir returns the Dirs field as the list of directories.

func (*DodFile) Seek

func (d *DodFile) Seek(offset int64, whence int) (int64, error)

Seek implements the io.Seeker interface.

func (DodFile) Stat

func (d DodFile) Stat() (os.FileInfo, error)

Stat returns the FileInfo associated wih the Dodfile.

type DodInfo

type DodInfo struct {
	FileName string
	FileSize int64
}

DodInfo implements the FileInfo for usage as a os.FileInfo.

func (DodInfo) IsDir

func (m DodInfo) IsDir() bool

IsDir returns always false.

func (DodInfo) IsRegular

func (m DodInfo) IsRegular() bool

IsRegular reports whether m describes a regular file.

func (DodInfo) ModTime

func (m DodInfo) ModTime() time.Time

ModTime returns the current time.

func (DodInfo) Mode

func (m DodInfo) Mode() os.FileMode

Mode returns the current time.

func (DodInfo) Name

func (m DodInfo) Name() string

Name returns the name associated for the DodInfo

func (DodInfo) Perm

func (m DodInfo) Perm() os.FileMode

Perm returns the Unix permission bits in m.

func (DodInfo) Size

func (m DodInfo) Size() int64

Size returns the size associated for the structure.

func (DodInfo) Sys

func (m DodInfo) Sys() interface{}

Sys returns always nil.

Jump to

Keyboard shortcuts

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