watcher

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: ISC Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watcher

type Watcher struct {
	Logger  log.Logger
	Details content.Details
	// contains filtered or unexported fields
}

Watcher reads documents from the filesystem on whenever it detects they have been updated interval and creates articles from them. Each document is related to an article with a shared key.

func (*Watcher) Get

func (w *Watcher) Get(key string) (content.Article, error)

Get returns a single article associated with the given key.

func (*Watcher) GetAll

func (w *Watcher) GetAll(pinned bool) []content.Article

GetAll returns all articles generated from documents

func (*Watcher) GetDetails

func (w *Watcher) GetDetails() content.Details

GetDetails returns the details of the content.

func (*Watcher) Start

func (w *Watcher) Start(articlesPath string, done chan bool, wg *sync.WaitGroup)

Watch starts a goroutine to watch for file updates in the given articlesPath. When an update is detected the

func (*Watcher) Update

func (w *Watcher) Update(key string, doc content.Document) error

Update modifies the underlying document associated with the given key.

Jump to

Keyboard shortcuts

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