Documentation ¶
Index ¶
- func HashFile(path string) (string, error)
- type MediaEntry
- type MediaLibrary
- func (library *MediaLibrary) AddFile(path string, size int64) error
- func (library *MediaLibrary) DescribeItem(hash string, description string) error
- func (library *MediaLibrary) FindByHash(hash string) *MediaEntry
- func (library *MediaLibrary) GetCatalog() ([]*MediaEntry, error)
- func (library *MediaLibrary) Ingest() error
- func (library *MediaLibrary) Reload() error
- func (library *MediaLibrary) RemoveFile(path string) error
- func (library *MediaLibrary) Save() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MediaEntry ¶
type MediaLibrary ¶
type MediaLibrary struct { Name string `json:"name"` RootDir string `json:"root_dir"` Description string `json:"description"` ImageLink string `json:"image,omitempty"` LastModified int64 `json:"last_modified"` CatalogFile string `json:"-"` Entries []*MediaEntry `json:"entries"` }
func Load ¶
func Load(name string) (*MediaLibrary, error)
func (*MediaLibrary) DescribeItem ¶
func (library *MediaLibrary) DescribeItem(hash string, description string) error
func (*MediaLibrary) FindByHash ¶
func (library *MediaLibrary) FindByHash(hash string) *MediaEntry
Attempts to locate a media entry based on the hash. If it is not found, the result will be nil
func (*MediaLibrary) GetCatalog ¶
func (library *MediaLibrary) GetCatalog() ([]*MediaEntry, error)
func (*MediaLibrary) Ingest ¶
func (library *MediaLibrary) Ingest() error
Recursively runs through the root directory and ensures that there's at least a key in the library metadata for that file
func (*MediaLibrary) Reload ¶
func (library *MediaLibrary) Reload() error
func (*MediaLibrary) RemoveFile ¶
func (library *MediaLibrary) RemoveFile(path string) error
func (*MediaLibrary) Save ¶
func (library *MediaLibrary) Save() error
Click to show internal directories.
Click to hide internal directories.