dao

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltMovieStore

type BoltMovieStore struct {
	// contains filtered or unexported fields
}

func InitDB

func InitDB(dbName string) (*BoltMovieStore, error)

func (*BoltMovieStore) AddMovie

func (store *BoltMovieStore) AddMovie(mov Movie) error

func (*BoltMovieStore) CreateBucket

func (store *BoltMovieStore) CreateBucket(bucketName string) error

func (*BoltMovieStore) DeleteMovie

func (store *BoltMovieStore) DeleteMovie(id string) error

func (*BoltMovieStore) GetAllMovies

func (store *BoltMovieStore) GetAllMovies() ([]Movie, error)

func (*BoltMovieStore) GetAllNotFoundMovies

func (store *BoltMovieStore) GetAllNotFoundMovies() ([]Movie, error)

func (*BoltMovieStore) GetMovie

func (store *BoltMovieStore) GetMovie(id string) (Movie, error)

func (*BoltMovieStore) UpdateMovie

func (store *BoltMovieStore) UpdateMovie(mov Movie) error

type Movie

type Movie struct {
	Title string `json:"title"`
	Year  int    `json:"year"`
	Ids   struct {
		Trakt int    `json:"trakt"`
		Slug  string `json:"slug"`
		Imdb  string `json:"imdb"`
		Tmdb  int    `json:"tmdb"`
	} `json:"ids"`
	MagnetLink   string    `json:"magnet_link"`
	LastModified time.Time `json:"last_modified"`
}

type MovieStore

type MovieStore interface {
	GetMovie(string) (Movie, error)
	AddMovie(Movie) error
	UpdateMovie(Movie) error
	DeleteMovie(string) error
	GetAllMovies() ([]Movie, error)
	GetAllNotFoundMovies() ([]Movie, error)
}

Jump to

Keyboard shortcuts

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