file

package
v0.0.0-...-1b2fc92 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2017 License: MIT Imports: 6 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 {
	rw.Prefixed
	// Root dir
	Dir string `json:"dir"`
	// Allow the creation of sub directories
	AllowSub bool `json:"allow_sub"`
	// Remove Empy directories on Delete.
	RemoveEmpty bool `json:"remove_empty"`
}

File defines a Directory to save files.

func (*File) Delete

func (s *File) Delete(id string) error

Delete a file

func (*File) NewReader

func (s *File) NewReader(id string) (io.ReadCloser, error)

NewReader read a file.

func (*File) NewWriter

func (s *File) NewWriter(id string) (io.WriteCloser, error)

NewWriter update or create a file.

func (*File) Start

func (s *File) Start() error

Start the File. Creates a tempdir is File.Dir == "".

Jump to

Keyboard shortcuts

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