dir

package module
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

View Source
var (
	ErrIsRoot           = errors.New("is root")
	ErrNoMatch          = errors.New("no match")
	ErrNotEmpty         = errors.New("not empty")
	ErrIsEmpty          = errors.New("is empty")
	ErrExists           = errors.New("already exists")
	ErrIsCurrentVersion = errors.New("is set as current version")
)

Errors

Functions

func FilePath

func FilePath(f File) string

FilePath returns the full path of the File

func Path

func Path(d Directory) string

Path returns the full path of the Directory

func VersionPath

func VersionPath(v Version) string

VersionPath returns the full path of the Version

Types

type Directory

type Directory interface {
	String() string
	UUID() uuid.UUID
	Name() string
	Rename(string) error
	Parent() Directory
	Ancestry() []Directory
	IsRoot() bool
	Root() Directory
	SetRoot(Directory) error
	Owner() User
	SetOwner(User) error
	Delete() error
	AttachDirectory(Directory) error
	DetachDirectory(Directory) error
	AttachFile(File) error
	DetachFile(File) error
	FindDirectories(*regexp.Regexp, int) ([]Directory, error)
	FindFiles(*regexp.Regexp, int) ([]File, error)
}

Directory is a directory

type File

type File interface {
	String() string
	UUID() uuid.UUID
	Name() string
	Rename(string) error
	Directory() Directory
	SetDirectory(Directory) error
	CurrentVersion() Version
	SetCurrentVersion(Version) error
	Owner() User
	SetOwner(User) error
	Delete() error
	AttachVersion(Version) error
	DetachVersion(Version) error
	FindVersions(time.Time, time.Time, User, int) ([]Version, error)
}

File is a file

type User

type User interface {
	String() string
	UUID() uuid.UUID
	Name() string
	SetName(string) error
}

User is a user

type Version

type Version interface {
	String() string
	UUID() uuid.UUID
	File() File
	SetFile(File) error
	Time() time.Time
	SetTime(time.Time) error
	Creator() User
	SetCreator(User) error
	Delete() error
}

Version is a version

Directories

Path Synopsis
examples
ex1

Jump to

Keyboard shortcuts

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