Versions in this module Expand all Collapse all v1 v1.2.0 Dec 25, 2022 v1.1.0 Dec 24, 2022 v1.0.1 Aug 25, 2022 v1.0.0 Jul 28, 2022 Changes in this version + const MediaTypeImage + const MediaTypeOther + const MediaTypeVideo + const OrientationLowerLeft + const OrientationLowerRight + const OrientationUpperLeft + const OrientationUpperRight + const ProgressEventAlbumCreated + const ProgressEventAlreadyExists + const ProgressEventAnalysed + const ProgressEventCatalogued + const ProgressEventDuplicate + const ProgressEventReadyForUpload + const ProgressEventScanComplete + const ProgressEventUploaded + const ProgressEventWrongAlbum + var BatchSize = 1 + var ConcurrentAnalyser = 1 + var ConcurrentCataloguer = 1 + var ConcurrentUploader = 1 + var MediaCounterZero = MediaCounter + var SupportedExtensions = map[string]MediaType + func Init(catalog CatalogAdapter, archive BArchiveAdapter) + func RegisterDetailsReader(reader DetailsReaderAdapter) + func Scan(owner string, volume SourceVolume, optionSlice ...Options) ([]*ScannedFolder, []FoundMedia, error) + type AnalysedMedia struct + Details *MediaDetails + FoundMedia FoundMedia + Sha256Hash string + Type MediaType + type BArchiveAdapter interface + ArchiveMedia func(owner string, media *BackingUpMediaRequest) (string, error) + type BackingUpMediaRequest struct + AnalysedMedia *AnalysedMedia + FolderName string + Id string + type CatalogAdapter interface + AssignIdsToNewMedias func(owner string, medias []*AnalysedMedia) (map[*AnalysedMedia]string, error) + GetAlbumsTimeline func(owner string) (TimelineAdapter, error) + IndexMedias func(owner string, requests []*CatalogMediaRequest) error + type CatalogMediaRequest struct + ArchiveFilename string + BackingUpMediaRequest *BackingUpMediaRequest + type ClosableFoundMedia interface + Close func() error + type CompletionReport interface + CountPerAlbum func() map[string]*TypeCounter + NewAlbums func() []string + Skipped func() MediaCounter + func Backup(owner string, volume SourceVolume, optionsSlice ...Options) (CompletionReport, error) + type DetailsReaderAdapter interface + ReadDetails func(reader io.Reader, options DetailsReaderOptions) (*MediaDetails, error) + Supports func(media FoundMedia, mediaType MediaType) bool + type DetailsReaderOptions struct + Fast bool + type FoundMedia interface + MediaPath func() MediaPath + ReadMedia func() (io.ReadCloser, error) + Size func() int + String func() string + func NewInmemoryMedia(name string, date time.Time, content []byte) FoundMedia + type FullMediaSignature struct + Sha256 string + Size uint + func (s *FullMediaSignature) String() string + type ImageOrientation string + type InmemoryMedia struct + func (i *InmemoryMedia) MediaPath() MediaPath + func (i *InmemoryMedia) ReadMedia() (io.ReadCloser, error) + func (i *InmemoryMedia) Size() int + func (i *InmemoryMedia) String() string + type MediaCounter struct + Count int + Size int + func NewMediaCounter(count int, size int) MediaCounter + func (c MediaCounter) Add(count int, size int) MediaCounter + func (c MediaCounter) AddCounter(counter MediaCounter) MediaCounter + func (c MediaCounter) IsZero() bool + type MediaDetails struct + DateTime time.Time + Duration int64 + GPSLatitude float64 + GPSLongitude float64 + Height int + Make string + Model string + Orientation ImageOrientation + VideoEncoding string + Width int + func (s *MediaDetails) String() string + type MediaPath struct + Filename string + ParentDir string + ParentFullPath string + Path string + Root string + type MediaType string + type Options struct + Listener interface{} + RestrictedAlbumFolderName map[string]interface{} + SkipRejects bool + func OptionOnlyAlbums(albums ...string) Options + func OptionSkipRejects(skip bool) Options + func OptionWithListener(listener interface{}) Options + type PostAnalyseFilter interface + AcceptAnalysedMedia func(media *AnalysedMedia, folderName string) bool + type ProgressEvent struct + Album string + Count int + MediaType MediaType + Size int + Type ProgressEventType + type ProgressEventType string + type ScannedFolder struct + AbsolutePath string + Distribution map[string]MediaCounter + End time.Time + FolderName string + Name string + RelativePath string + Start time.Time + func (f *ScannedFolder) PushBoundaries(date time.Time, size int) + type SourceVolume interface + FindMedias func() ([]FoundMedia, error) + String func() string + type TimelineAdapter interface + FindAlbum func(dateTime time.Time) (folderName string, exists bool, err error) + FindOrCreateAlbum func(mediaTime time.Time) (folderName string, created bool, err error) + type TrackAnalysed interface + OnAnalysed func(done, total MediaCounter) + type TrackEvents interface + OnEvent func(event ProgressEvent) + type TrackScanComplete interface + OnScanComplete func(total MediaCounter) + type TrackUploaded interface + OnUploaded func(done, total MediaCounter) + type Tracker struct + Done chan struct{} + func NewTracker(progressChannel chan *ProgressEvent, listeners ...interface{}) *Tracker + func (t *Tracker) CountPerAlbum() map[string]*TypeCounter + func (t *Tracker) NewAlbums() []string + func (t *Tracker) Skipped() MediaCounter + func (t *Tracker) WaitToComplete() + type TypeCounter struct + func NewTypeCounter(mediaType MediaType, count int, size int) *TypeCounter + func (c *TypeCounter) GetMediaIndex(mediaType MediaType) int + func (c *TypeCounter) IncrementCounter(counter *[numberOfMediaType]int, mediaType MediaType, delta int) + func (c *TypeCounter) IncrementFoundCounter(mediaType MediaType, count int, size int) *TypeCounter + func (c *TypeCounter) OfType(mediaType MediaType) MediaCounter + func (c *TypeCounter) Total() MediaCounter