files

package
v0.0.0-...-5a689ec Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2018 License: ISC Imports: 5 Imported by: 0

Documentation

Overview

Package files turns javascript files into io.Reader's

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClosed = errors.New("file closed")
)

Errors

Functions

This section is empty.

Types

type Blob

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

Blob is a wrapped javascript blob

func NewBlob

func NewBlob(b *js.Object) Blob

NewBlob wraps a javascript blob

func (Blob) Len

func (b Blob) Len() int

Len returns the length of the blob

func (Blob) Slice

func (b Blob) Slice(i, j int) Blob

Slice returns a new blob sliced with the given indicies

func (Blob) Type

func (b Blob) Type() string

Type returns the type of the blob

type File

type File struct {
	Blob
}

File wraps a Blob

func NewFile

func NewFile(f *dom.File) File

NewFile wraps a javascript File to access

func (File) LastModifiedDate

func (f File) LastModifiedDate() time.Time

LastModifiedDate returns the last modified time for the file

func (File) Name

func (f File) Name() string

Name returns the files name

type FileReader

type FileReader struct {
	File
	// contains filtered or unexported fields
}

FileReader wraps a File to allow for reading

func NewFileReader

func NewFileReader(f File) *FileReader

NewFileReader opens a File for reading

func (*FileReader) Close

func (fr *FileReader) Close() error

Close implements the io.Closer interface

func (*FileReader) Read

func (fr *FileReader) Read(b []byte) (int, error)

Read implements the io.Reader interface

func (*FileReader) ReadAt

func (fr *FileReader) ReadAt(b []byte, off int64) (int, error)

ReadAt implements the io.ReaderAt interface

func (*FileReader) Seek

func (fr *FileReader) Seek(offset int64, whence int) (int64, error)

Seek implements the io.Seeker interface

Jump to

Keyboard shortcuts

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