Documentation ¶
Index ¶
- Constants
- type FileSystem
- func (fs FileSystem) Close() error
- func (f FileSystem) CreateAnime(anime domain.AnimeBase) (*os.File, error)
- func (fs FileSystem) CreateBannerImage(reader io.Reader) (string, error)
- func (fs FileSystem) CreatePathAnime(anime domain.AnimeBase) string
- func (fs FileSystem) CreatePosterImage(reader io.Reader) (string, error)
- func (fs FileSystem) CreateTempAnime(anime domain.AnimeBase) (*os.File, error)
- func (fs FileSystem) CreateTempImage() (*os.File, error)
- func (fs FileSystem) CreateThumbnailImage(reader io.Reader) (string, error)
- func (fs FileSystem) DeleteAnime(anime domain.AnimeBase) (err error)
- func (fs FileSystem) DeleteBannerImage(filename string) error
- func (fs FileSystem) DeletePosterImage(filename string) error
- func (fs FileSystem) DeleteThumbnailImage(filename string) error
- func (fs FileSystem) EnsureDirectories() (err error)
- func (fs FileSystem) GetAnime(anime domain.AnimeBase) (io.ReadCloser, error)
- func (fs FileSystem) GetBannerImages() ([]fs.DirEntry, error)
- func (fs FileSystem) GetBannerPath() string
- func (fs FileSystem) GetDownloadsPath() string
- func (fs FileSystem) GetImagesPath() string
- func (fs FileSystem) GetPosterImages() ([]fs.DirEntry, error)
- func (fs FileSystem) GetPosterPath() string
- func (fs FileSystem) GetTemporaryDownloadsPath() string
- func (fs FileSystem) GetThumbnailImages() ([]fs.DirEntry, error)
- func (fs FileSystem) GetThumbnailPath() string
- func (fs FileSystem) HasAnime(anime domain.AnimeBase) bool
- func (fs FileSystem) HasBannerImage(hash string) bool
- func (fs FileSystem) HasPosterImage(hash string) bool
- func (fs FileSystem) HasThumbnailImage(hash string) bool
- func (f FileSystem) L() *zap.Logger
Constants ¶
const ( // ExtensionImage is the format images are going to be saved as ExtensionImage string = ".jpg" // ExtensionVideo is the format videos are going to be saved as ExtensionVideo string = ".mp4" // ThumbnailDir defines the sub-dir used to store thumbnails. ThumbnailDir string = "thumbnail" // PosterDir defines the sub-dir used to store posters. PosterDir string = "poster" // BannerDir defines the sub-dir used to store banners. BannerDir string = "banner" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSystem ¶
type FileSystem struct {
// contains filtered or unexported fields
}
FileSystem is made up of methods will help us have better Input/Output control over out anime/images.
func NewFileSystem ¶
func NewFileSystem(c configmodels.Directories) (fs *FileSystem)
NewFileSystem creates a new instance of the filesystem with the provided configuration, while initializing the patternizer.
func (FileSystem) Close ¶
func (fs FileSystem) Close() error
Close removes the `temporary_downloads` path along with it's contents.
func (FileSystem) CreateAnime ¶
CreateAnime creates a file based on the created anime and it's base/parent dir is ensured that it's created.
func (FileSystem) CreateBannerImage ¶
func (fs FileSystem) CreateBannerImage(reader io.Reader) (string, error)
func (FileSystem) CreatePathAnime ¶
func (fs FileSystem) CreatePathAnime(anime domain.AnimeBase) string
func (FileSystem) CreatePosterImage ¶
func (fs FileSystem) CreatePosterImage(reader io.Reader) (string, error)
func (FileSystem) CreateTempAnime ¶
func (FileSystem) CreateTempImage ¶
func (fs FileSystem) CreateTempImage() (*os.File, error)
func (FileSystem) CreateThumbnailImage ¶
func (fs FileSystem) CreateThumbnailImage(reader io.Reader) (string, error)
func (FileSystem) DeleteAnime ¶
func (fs FileSystem) DeleteAnime(anime domain.AnimeBase) (err error)
DeleteAnime will delete an anime. It won't throw an execption if it doesn't exist.
func (FileSystem) DeleteBannerImage ¶
func (fs FileSystem) DeleteBannerImage(filename string) error
func (FileSystem) DeletePosterImage ¶
func (fs FileSystem) DeletePosterImage(filename string) error
func (FileSystem) DeleteThumbnailImage ¶
func (fs FileSystem) DeleteThumbnailImage(filename string) error
func (FileSystem) EnsureDirectories ¶
func (fs FileSystem) EnsureDirectories() (err error)
EnsureDirectories ensures that all directories within the config.Paths are created.
func (FileSystem) GetAnime ¶
func (fs FileSystem) GetAnime(anime domain.AnimeBase) (io.ReadCloser, error)
func (FileSystem) GetBannerImages ¶
func (fs FileSystem) GetBannerImages() ([]fs.DirEntry, error)
func (FileSystem) GetBannerPath ¶
func (fs FileSystem) GetBannerPath() string
GetBannerPath returns the banners path
func (FileSystem) GetDownloadsPath ¶
func (fs FileSystem) GetDownloadsPath() string
GetDownloadsPath returns the downloads path
func (FileSystem) GetImagesPath ¶
func (fs FileSystem) GetImagesPath() string
GetImagesPath returns the images path.
func (FileSystem) GetPosterImages ¶
func (fs FileSystem) GetPosterImages() ([]fs.DirEntry, error)
func (FileSystem) GetPosterPath ¶
func (fs FileSystem) GetPosterPath() string
GetPosterPath returns the posters path
func (FileSystem) GetTemporaryDownloadsPath ¶
func (fs FileSystem) GetTemporaryDownloadsPath() string
GetTemporaryDownloadsPath returns the temporary downloads path
func (FileSystem) GetThumbnailImages ¶
func (fs FileSystem) GetThumbnailImages() ([]fs.DirEntry, error)
func (FileSystem) GetThumbnailPath ¶
func (fs FileSystem) GetThumbnailPath() string
GetThumbnailPath returns the thumbnails path
func (FileSystem) HasBannerImage ¶
func (fs FileSystem) HasBannerImage(hash string) bool
func (FileSystem) HasPosterImage ¶
func (fs FileSystem) HasPosterImage(hash string) bool
func (FileSystem) HasThumbnailImage ¶
func (fs FileSystem) HasThumbnailImage(hash string) bool