storage

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppConfiguration = &models.AppConfiguration{}

AppConfiguration app configuration global

View Source
var Db = &Storage{}

Db database session

View Source
var DbDir = ""

DbDir application configuration directory

Functions

func GetAllMovies added in v0.2.0

func GetAllMovies() ([]*models.Movie, error)

GetAllMovies get all movies

func GetAllShows added in v0.1.0

func GetAllShows() ([]*models.Show, error)

GetAllShows get all shows

func Init

func Init(configDir string) error

Init initialize global Db

func SortEpisodes added in v0.1.0

func SortEpisodes(episodes models.Episodes)

SortEpisodes sort array of episodes

Types

type Collections

type Collections struct {
	Movies        string
	Shows         string
	Configuration string
}

Collections All collections available

type MovieStorage added in v0.2.0

type MovieStorage struct {
	*models.Movie
}

MovieStorage storage methods for Movies

func NewMovieStorage added in v0.2.0

func NewMovieStorage(movie *models.Movie) *MovieStorage

NewMovieStorage create new MovieStorage

func (*MovieStorage) Save added in v0.2.0

func (m *MovieStorage) Save() (*MovieStorage, error)

Save save on database

type ShowStorage

type ShowStorage struct {
	*models.Show
}

ShowStorage storage methods for shows

func NewShowStorage

func NewShowStorage(show *models.Show) *ShowStorage

NewShowStorage create new ShowStorage

func (*ShowStorage) AddOrUpdateEpisode

func (s *ShowStorage) AddOrUpdateEpisode(*models.TorrentInfo) (*ShowStorage, error)

AddOrUpdateEpisode Add or update an episode if already exist

func (*ShowStorage) Save

func (s *ShowStorage) Save() (*ShowStorage, error)

Save save on database

type Storage

type Storage struct {
	Directory   string
	Driver      *scribble.Driver
	Collections *Collections
}

Storage manage storage

func New

func New(dir string, options *scribble.Options) (*Storage, error)

New create a new Storage

func (*Storage) AddMediaDir added in v0.1.2

func (s *Storage) AddMediaDir(directory string) error

AddMediaDir add a new media directory

func (*Storage) GetAppConfiguration

func (s *Storage) GetAppConfiguration(configuration *models.AppConfiguration) (*models.AppConfiguration, error)

GetAppConfiguration get couchness configuration

Jump to

Keyboard shortcuts

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