Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // WorkerQueue channel controller WorkerQueue chan chan Image // WorkQueue channel WorkQueue chan Image // WorkerStop quit channel WorkerStop chan bool )
var ImageDir string
ImageDir is where you keep your images. Needs write permissions on `thumbs` subdirectory
Functions ¶
func StartDispatcher ¶
func StartDispatcher(nworkers int)
StartDispatcher creates nworkers and distributes incoming work to them
func StopDispatcher ¶
func StopDispatcher()
StopDispatcher blocks until all workers have finished and queues are closed
Types ¶
type ImageCache ¶
ImageCache threadsafe cache
var Images ImageCache
Images global, stores a cache of gallery entries and if they have valid thumbnails or not
func (*ImageCache) Set ¶
func (c *ImageCache) Set(id int, img Image)
Set the value of a gallery entry
func (*ImageCache) Update ¶
func (c *ImageCache) Update() error
Update will rescan the directory for any files that don't have a thumbnail and attempt to generate one
type WorkRequest ¶
WorkRequest to be exported to json
type Worker ¶
Worker type
func NewWorker ¶
NewWorker creates, and returns a new Worker object. Its only argument is a channel that the worker can add itself to whenever it is done its work.