Versions in this module Expand all Collapse all v1 v1.0.0 Jun 20, 2021 Changes in this version + const EntityPath + type AudioEntity struct + func (e *AudioEntity) Date() time.Time + func (e *AudioEntity) Description() string + func (e *AudioEntity) ID() string + func (e *AudioEntity) MetaPath() string + func (e *AudioEntity) MimeType() string + func (e *AudioEntity) Path() string + func (e *AudioEntity) SystemPath() string + type Entity interface + Date func() time.Time + Description func() string + ID func() string + MetaPath func() string + MimeType func() string + Path func() string + SystemPath func() string + type ImageEntity struct + Height int + Width int + func (e *ImageEntity) Date() time.Time + func (e *ImageEntity) Description() string + func (e *ImageEntity) ID() string + func (e *ImageEntity) MetaPath() string + func (e *ImageEntity) MimeType() string + func (e *ImageEntity) Path() string + func (e *ImageEntity) SystemPath() string + type Moment struct + Author string + Date time.Time + Text string + Title string + func (m *Moment) DateString() string + func (m *Moment) Path() string + type Shelf struct + func New(storage *Storage) *Shelf + func (shelf *Shelf) AddImageEntity(mimeType string, buffer []byte) (*ImageEntity, error) + func (shelf *Shelf) AddVideoEntity(mimeType string, r io.Reader) (*VideoEntity, error) + func (shelf *Shelf) FindAllEntities() []Entity + func (shelf *Shelf) FindAllEntitiesByYear(year int) []Entity + func (shelf *Shelf) FindAllMoments() []*Moment + func (shelf *Shelf) FindAllMomentsByYear(year int) []*Moment + func (shelf *Shelf) Init() error + func (shelf *Shelf) LookupEntity(id string) Entity + func (shelf *Shelf) LookupMoment(path string) *Moment + func (shelf *Shelf) NumEntities() int + func (shelf *Shelf) NumMoments() int + func (shelf *Shelf) RemoveEntity(entity Entity) error + func (shelf *Shelf) SaveMoment(origTime time.Time, m *Moment) error + type Storage struct + func NewStorage(dirPath string) (*Storage, error) + func (s *Storage) CreateFile(path string) (*os.File, error) + func (s *Storage) Exists(path string) bool + func (s *Storage) Mkdir(path string) error + func (s *Storage) OpenFile(path string) (*os.File, error) + func (s *Storage) OpenTempFile(ext string) (string, *os.File, error) + func (s *Storage) ReadFile(path string) ([]byte, error) + func (s *Storage) Remove(path string) error + func (s *Storage) Rename(old, new string) error + func (s *Storage) RenameFileWithBytes(old, new string, content []byte) error + func (s *Storage) UpdateFileWithBytes(path string, content []byte) error + func (s *Storage) UpdateFileWithReader(path string, reader io.Reader) error + func (s *Storage) UpdateFileWithTempFile(path string, tmpFile *os.File) error + func (s *Storage) WalkFiles(path string, fn func(path string, info os.FileInfo, err error) error) error + func (s *Storage) WriteFile(path string, content []byte) error + type VideoEntity struct + Duration float64 + Height int + Width int + func (e *VideoEntity) Date() time.Time + func (e *VideoEntity) Description() string + func (e *VideoEntity) ID() string + func (e *VideoEntity) MetaPath() string + func (e *VideoEntity) MimeType() string + func (e *VideoEntity) Path() string + func (e *VideoEntity) SystemPath() string