file

package
v0.0.0-...-da116bd Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2015 License: MIT Imports: 4 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 {
	sync.RWMutex
	// contains filtered or unexported fields
}

File is an implementation of dir.File

func CreateFile

func CreateFile(d dir.Directory, name string) *File

CreateFile creates a File in the provided Directory

func (*File) AttachVersion

func (f *File) AttachVersion(v dir.Version) error

AttachVersion attaches a dir.Version to this file This checks to ensure the provided dir.Version isn't a duplicate before it attaches it.

func (*File) CurrentVersion

func (f *File) CurrentVersion() dir.Version

CurrentVersion returns the File's current Version (which might not be the newest one)

func (*File) Delete

func (f *File) Delete() error

Delete deletes the File

func (*File) DetachVersion

func (f *File) DetachVersion(v dir.Version) error

DetachVersion removes a dir.Version from this File This is intended to be called from the target File's .Delete() method itself. This does not test that the Version is ready to be deleted, whatever that means.

func (*File) Directory

func (f *File) Directory() dir.Directory

Directory returns the File's Directory (if attached to one)

func (*File) FindVersions

func (f *File) FindVersions(after time.Time, before time.Time, creator dir.User, recurseLevel int) ([]dir.Version, error)

FindVersions searches for one or more Version entries The `after`, `before`, and `creator` arguments are all optional and will be used in an `AND` search, if provided.

func (*File) Name

func (f *File) Name() string

Name returns the file's name

func (*File) Owner

func (f *File) Owner() dir.User

Owner returns the file owner's dir.User

func (*File) Rename

func (f *File) Rename(name string) error

Rename sets the file's name

func (*File) SetCurrentVersion

func (f *File) SetCurrentVersion(currentVersion dir.Version) error

SetCurrentVersion sets the File's current Version (doesn't have to be the newest Version)

func (*File) SetDirectory

func (f *File) SetDirectory(d dir.Directory) error

SetDirectory sets the File's Directory

func (*File) SetOwner

func (f *File) SetOwner(owner dir.User) error

SetOwner returns the file owner's dir.User

func (*File) String

func (f *File) String() string

func (*File) UUID

func (f *File) UUID() uuid.UUID

UUID returns the file's UUID

Jump to

Keyboard shortcuts

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