Documentation
¶
Index ¶
- Variables
- type File
- type Index
- func (index *Index) Add(item dataaccess.Item) (bool, error)
- func (index *Index) Copy() *Index
- func (index *Index) GetAllChildren(route route.Route, limitDepth bool, maxDepth int) []dataaccess.Item
- func (index *Index) GetAllItems() []dataaccess.Item
- func (index *Index) GetDirectChildren(route route.Route) []dataaccess.Item
- func (index *Index) GetLeafes(route route.Route) []dataaccess.Item
- func (index *Index) GetParent(childRoute route.Route) dataaccess.Item
- func (index *Index) GetSubIndex(subIndexStartRoute route.Route, limitDepth bool, maxDepth int) *Index
- func (index *Index) IsMatch(r route.Route) (item dataaccess.Item, isMatch bool)
- func (index *Index) Remove(itemRoute route.Route)
- func (index *Index) Size() int
- func (index *Index) String() string
- type Item
- func (item *Item) CanHaveChildren() bool
- func (item *Item) Directory() string
- func (item *Item) Files() (files []dataaccess.File)
- func (item *Item) Id() string
- func (item *Item) Route() route.Route
- func (item *Item) String() string
- func (item *Item) Type() dataaccess.ItemType
- func (item *Item) WatcherPaths() []watcherPather
- type ItemTree
- func (itemTree *ItemTree) Delete(itemRoute route.Route) (bool, error)
- func (itemTree *ItemTree) GetChildItems(route route.Route) []dataaccess.Item
- func (itemTree *ItemTree) GetItem(route route.Route) dataaccess.Item
- func (itemTree *ItemTree) Insert(item dataaccess.Item) (bool, error)
- func (itemTree *ItemTree) Root() dataaccess.Item
- func (itemTree *ItemTree) Walk(expression func(item dataaccess.Item))
- type Repository
- func (repository *Repository) Item(route route.Route) dataaccess.Item
- func (repository *Repository) Items() []dataaccess.Item
- func (repository *Repository) Path() string
- func (repository *Repository) Routes() []route.Route
- func (repository *Repository) StartWatching(route route.Route)
- func (repository *Repository) StopWatching(route route.Route)
- func (repository *Repository) Subscribe(updates chan dataaccess.Update)
Constants ¶
This section is empty.
Variables ¶
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 }
type Index ¶ added in v0.10.0
type Index struct {
// contains filtered or unexported fields
}
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) IsMatch ¶ added in v0.10.0
IsMatch checks if the specified route can be found in the index.
func (*Index) Remove ¶ added in v0.10.0
Remove removes the item with the supplied route from the index.
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
Gets a flag inidicating whether this item can have children or not.
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) 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
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 (*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.