repository

package
v0.0.0-...-fb119ec Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByLearned

type ByLearned []entity.Word

func (ByLearned) Len

func (a ByLearned) Len() int

func (ByLearned) Less

func (a ByLearned) Less(i, j int) bool

func (ByLearned) Swap

func (a ByLearned) Swap(i, j int)

type QueryRepo

type QueryRepo interface {
	SetDb(db *mgo.Database)
	FetchWord(collectionName string, objectId bson.ObjectId) (entity.Word, error)
	FetchDictionary(collectionName string, query bson.M) (interface{}, error)
	FilterDictionary(limit int) (interface{}, error)
	UpdateWord(collectionName string, objectId bson.ObjectId, data interface{}) error
}

func CreateRepo

func CreateRepo(mgoDb *mgo.Database) QueryRepo

type Repo

type Repo struct {
	Db *mgo.Database
	// contains filtered or unexported fields
}

func (*Repo) FetchDictionary

func (r *Repo) FetchDictionary(collectionName string, query bson.M) (interface{}, error)

func (*Repo) FetchWord

func (r *Repo) FetchWord(collectionName string, objectId bson.ObjectId) (entity.Word, error)

func (*Repo) FilterDictionary

func (r *Repo) FilterDictionary(limit int) (interface{}, error)

func (*Repo) SetDb

func (r *Repo) SetDb(db *mgo.Database)

func (*Repo) UpdateWord

func (r *Repo) UpdateWord(collectionName string, objectId bson.ObjectId, data interface{}) error

Jump to

Keyboard shortcuts

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