file

package
v0.0.0-...-c77f481 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Url         string
	Status      *status.Status
	Size        int64
	Proxy       string
	StoragePath string
	SkipVerify  bool
	// contains filtered or unexported fields
}

file struct

func (*File) Data

func (f *File) Data() ([]byte, error)

read the file data in bytes

func (*File) Delete

func (f *File) Delete()

simply removes file if its already fetched

func (*File) Fetch

func (f *File) Fetch(timeout int, concurrent bool) error

validates file if remote fetches file sets path location forthe stored file

func (*File) IsRemote

func (f *File) IsRemote() bool

checks file is not on local TODO add file:/// support

func (*File) Path

func (f *File) Path() string

file location on local host if file is remote file something like http/https path will be present after file is downloaded so you need to call Fetch method first

func (*File) Reset

func (f *File) Reset()

a bit of ugly but resets global variable check variable comment for details

func (*File) Terminate

func (f *File) Terminate()

type IFile

type IFile interface {
	Path() string
	Data() ([]byte, error)
	Fetch(timeout int, concurrent bool) error
	IsRemote() bool
	Delete()
	Reset()
	Terminate()
}

file interface

Jump to

Keyboard shortcuts

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