resource

package
v0.0.0-...-d8e89f0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DocsDir is the path to the Documentation directory
	DocsDir = "docs"
	// FileDir is the path to where files will be stored
	FileDir = "file"
	// CoreDSDir is where the core datastore files will be stored
	CoreDSDir = "core"
	// DatastoreDir is where user datastore files will be stored
	DatastoreDir = "datastore"
	// AvailableAppDir is where new available application zip files are stored
	AvailableAppDir = AppDir + string(os.PathSeparator) + "available"
	// AppDir are were installed applications are installed to
	AppDir = "application"
)

Variables

This section is empty.

Functions

func IsRestrictedPath

func IsRestrictedPath(path string) bool

IsRestrictedPath is whether or not the passed in path is allowed to be created. i.e Not a version and not a doc

func ModTimeFromRequest

func ModTimeFromRequest(r *http.Request) time.Time

ModTimeFromRequest returns the time parsed from the fh-modified header If the header doesn't exist, it returns a Zero time

func WriteFile

func WriteFile(reader io.ReadCloser, filePath string, overwrite bool, modTime time.Time) error

WriteFile writes the contents of the reader buffered, and closes it

Types

type File

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

File is a freehold file

func NewFile

func NewFile(url string) *File

NewFile returns a new freehold file object

func NewFileFromProperty

func NewFileFromProperty(url string) *File

NewFileFromProperty returns a freehold file object from the passed in property url

func (*File) Children

func (r *File) Children() ([]*File, error)

Children returns the child files of the current directory

func (*File) Exists

func (r *File) Exists() bool

Exists is whether or not this file exists

func (*File) FileInfo

func (r *File) FileInfo() os.FileInfo

FileInfo is the FileInfo object returned by the OS

func (*File) Filepath

func (r *File) Filepath() string

Filepath is the path to the file

func (*File) ID

func (r *File) ID() string

ID is the unique identifier for this file

func (*File) IsDatastore

func (r *File) IsDatastore() bool

IsDatastore is whether or not this file is a datastore

func (*File) IsDir

func (r *File) IsDir() bool

IsDir is whether or not this file is a directory

func (*File) IsHidden

func (r *File) IsHidden() bool

IsHidden is whether or not freehold sees this file as hidden freehold will accept regular files starting with ., but not datastore files

func (*File) Modified

func (r *File) Modified() string

Modified is a JSON string value of when the file was last modified

func (*File) Move

func (r *File) Move(to *File) error

Move moves the file to the new location

func (*File) Name

func (r *File) Name() string

Name is the name of the file without the path

func (*File) Parent

func (r *File) Parent() *File

Parent returns the parent directory of the current file

func (*File) Permission

func (r *File) Permission() (*permission.Permission, error)

Permission retrieves the freehold permissions for this file

func (*File) Size

func (r *File) Size() int64

Size is the size of the file in bytes

func (*File) URL

func (r *File) URL() string

URL is the url to this file

Jump to

Keyboard shortcuts

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