filesystem

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2017 License: BSD-3-Clause Imports: 19 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReservedDirectoryNames = []string{config.FilesDirectoryName, config.MetaDataFolderName}
)

Functions

This section is empty.

Types

type File added in v0.10.0

type File struct {
	*content.ContentProvider
	// contains filtered or unexported fields
}

func (*File) Id added in v0.10.0

func (file *File) Id() string

func (*File) Name added in v0.10.0

func (file *File) Name() string

func (*File) Parent added in v0.10.0

func (file *File) Parent() route.Route

func (*File) Route added in v0.10.0

func (file *File) Route() route.Route

func (*File) String added in v0.10.0

func (file *File) String() string

type Index added in v0.10.0

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

func (*Index) Add added in v0.10.0

func (index *Index) Add(item dataaccess.Item) (bool, error)

func (*Index) Copy added in v0.10.0

func (index *Index) Copy() *Index

Copy creates a copy of the current index

func (*Index) GetAllChildren added in v0.10.0

func (index *Index) GetAllChildren(route route.Route, limitDepth bool, maxDepth int) []dataaccess.Item

Get all children that match the given expression

func (*Index) GetAllItems added in v0.10.0

func (index *Index) GetAllItems() []dataaccess.Item

GetAllItems returns a flat list of all items in the index.

func (*Index) GetDirectChildren added in v0.10.0

func (index *Index) GetDirectChildren(route route.Route) []dataaccess.Item

func (*Index) GetLeafes added in v0.10.0

func (index *Index) GetLeafes(route route.Route) []dataaccess.Item

func (*Index) GetParent added in v0.10.0

func (index *Index) GetParent(childRoute route.Route) dataaccess.Item

GetParent returns the parent of the specified route if there is one. Otherwise GetParent will return nil.

func (*Index) GetSubIndex added in v0.10.0

func (index *Index) GetSubIndex(subIndexStartRoute route.Route, limitDepth bool, maxDepth int) *Index

func (*Index) IsMatch added in v0.10.0

func (index *Index) IsMatch(r route.Route) (item dataaccess.Item, isMatch bool)

IsMatch checks if the specified route can be found in the index.

func (*Index) Remove added in v0.10.0

func (index *Index) Remove(itemRoute route.Route)

Remove removes the item with the supplied route from the index.

func (*Index) Size added in v0.10.0

func (index *Index) Size() int

Size returns the number if items in the index.

func (*Index) String added in v0.10.0

func (index *Index) String() string

type Item added in v0.10.0

type Item struct {
	*content.ContentProvider
	// contains filtered or unexported fields
}

An Item represents a single document in a repository.

func (*Item) CanHaveChildren added in v0.10.0

func (item *Item) CanHaveChildren() bool

Gets a flag inidicating whether this item can have children or not.

func (*Item) Directory added in v0.10.0

func (item *Item) Directory() string

func (*Item) Files added in v0.10.0

func (item *Item) Files() (files []dataaccess.File)

Get the files of this item. Returns a slice of zero or more files.

func (*Item) Id added in v0.10.0

func (item *Item) Id() string

func (*Item) Route added in v0.10.0

func (item *Item) Route() route.Route

Get the route of this item.

func (*Item) String added in v0.10.0

func (item *Item) String() string

func (*Item) Type added in v0.10.0

func (item *Item) Type() dataaccess.ItemType

Get the type of this item (e.g. "physical", "virtual", ...)

func (*Item) WatcherPaths added in v0.10.0

func (item *Item) WatcherPaths() []watcherPather

type ItemTree added in v0.10.0

type ItemTree struct {
	tree.Tree
}

func (*ItemTree) Delete added in v0.10.0

func (itemTree *ItemTree) Delete(itemRoute route.Route) (bool, error)

func (*ItemTree) GetChildItems added in v0.10.0

func (itemTree *ItemTree) GetChildItems(route route.Route) []dataaccess.Item

func (*ItemTree) GetItem added in v0.10.0

func (itemTree *ItemTree) GetItem(route route.Route) dataaccess.Item

func (*ItemTree) Insert added in v0.10.0

func (itemTree *ItemTree) Insert(item dataaccess.Item) (bool, error)

func (*ItemTree) Root added in v0.10.0

func (itemTree *ItemTree) Root() dataaccess.Item

func (*ItemTree) Walk added in v0.10.0

func (itemTree *ItemTree) Walk(expression func(item dataaccess.Item))

Walk visits every node in the current tree. Starting with the root, every child of the root and then recurses down the children.

type Repository

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

func NewRepository

func NewRepository(logger logger.Logger, directory string, config config.Config) (*Repository, error)

func (*Repository) Item

func (repository *Repository) Item(route route.Route) dataaccess.Item

func (*Repository) Items

func (repository *Repository) Items() []dataaccess.Item

func (*Repository) Path

func (repository *Repository) Path() string

func (*Repository) Routes

func (repository *Repository) Routes() []route.Route

func (*Repository) StartWatching

func (repository *Repository) StartWatching(route route.Route)

StartWatching starts the watcher for the item with the given route.

func (*Repository) StopWatching

func (repository *Repository) StopWatching(route route.Route)

StopWatching stops the watcher for the item with the given route.

func (*Repository) Subscribe added in v0.10.0

func (repository *Repository) Subscribe(updates chan dataaccess.Update)

Subscribe registers the supplied updates channel in the repository. All updates (new, modified or deleted items) in the repository will be passed down this channel.

Jump to

Keyboard shortcuts

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