store

package
v12.1.8 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Movie

type Movie struct {
	ID          primitive.ObjectID `json:"_id" bson:"_id"` /* you need the bson:"_id" to be able to retrieve with ID filled */
	Name        string             `json:"name"`
	Cover       string             `json:"cover"`
	Description string             `json:"description"`
}

type MovieService

type MovieService interface {
	GetAll(ctx context.Context) ([]Movie, error)
	GetByID(ctx context.Context, id string) (Movie, error)
	Create(ctx context.Context, m *Movie) error
	Update(ctx context.Context, id string, m Movie) error
	Delete(ctx context.Context, id string) error
}

func NewMovieService

func NewMovieService(collection *mongo.Collection) MovieService

Jump to

Keyboard shortcuts

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