datastore

package
v0.0.0-...-b829c5b Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CollectionName = "anime"
)

Variables

This section is empty.

Functions

func CreateSession

func CreateSession() (*mgo.Session, error)

Types

type AnimeRepository

type AnimeRepository struct {
	Session *mgo.Session
}

func (*AnimeRepository) Close

func (repo *AnimeRepository) Close()

Close Session

func (*AnimeRepository) Create

func (repo *AnimeRepository) Create(anime *proto.Anime) error

Create new Anime

func (*AnimeRepository) FindAll

func (repo *AnimeRepository) FindAll() ([]*proto.Anime, error)

FindAll anime possible with limit 20

func (*AnimeRepository) FindByQuery

func (repo *AnimeRepository) FindByQuery(request map[string]interface{}) ([]*proto.Anime, error)

FindByQuery get anime by query provided

type Repository

type Repository interface {
	Create(*proto.Anime) error
	FindAll() ([]*proto.Anime, error)
	FindByQuery(request map[string]interface{}) ([]*proto.Anime, error)
	Close()
}

Jump to

Keyboard shortcuts

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