imageservice

package
v0.0.0-...-69fb0f4 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	Name   string `json:"name"`
	Width  int    `json:"width"`
	Height int    `json:"height"`
}

Image represents an image on disk.

type ImageList

type ImageList map[string]Image

ImageList is an aggregation of Images

type Service

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

Service defines a structure for watching a directory for image files changes, and getting the images in the directory.

func New

func New(logger *logrus.Logger) *Service

New returns a reference to a new Service, or a nil reference and and an error if something goes wrong setting up the store for the given directory.

func (*Service) Files

func (s *Service) Files() ImageList

Files returns the list of files current in the store.

func (*Service) Stop

func (s *Service) Stop()

Stop makes the service finish watching the directory, and cleanup resources.

func (*Service) Watch

func (s *Service) Watch(dir string) error

Watch starts the Service watching a specific directory.

Jump to

Keyboard shortcuts

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