Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Datasource ¶
type Datasource struct {
// contains filtered or unexported fields
}
Datasource manages the movies data.
func NewDatasource ¶
func NewDatasource(db *bolt.DB) *Datasource
NewDatasource creates a new instance of movie datasource.
func (*Datasource) Fetch ¶
func (ds *Datasource) Fetch(id string) (Movie, error)
Fetch fetches the movie by id, if not exist an error will be returned.
func (*Datasource) FetchAll ¶
func (ds *Datasource) FetchAll() (Movies, error)
FetchAll retrieves all the movies stored.
func (*Datasource) Remove ¶
func (ds *Datasource) Remove(id string) error
Remove removes the movie from database, if some error occurs, an error will be returned.
type Date ¶
Date it is a custom struct for masharlling and unmarshalling dates.
func (Date) MarshalJSON ¶
MarshalJSON marshals a Date into a "Y-m-d" format.
func (*Date) UnmarshalJSON ¶
UnmarshalJSON unmarshals the string date into Date instance.
Click to show internal directories.
Click to hide internal directories.