models

package
v0.0.0-...-2778f3f Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAll

func FindAll(db, collection string, query, selector, result interface{}) error

func FindOne

func FindOne(db, collection string, query, selector, result interface{}) error

func Insert

func Insert(db, collection string, docs ...interface{}) error

func IsExist

func IsExist(db, collection string, query interface{}) bool

func Remove

func Remove(db, collection string, query interface{}) error

func Update

func Update(db, collection string, query, update interface{}) error

Types

type JwtToken

type JwtToken struct {
	Token string `json:"token"`
}

type Movies

type Movies struct {
	Id          bson.ObjectId `bson:"_id" json:"id"`
	Name        string        `bson:"name" json:"name"`
	CoverImage  string        `bson:"cover_image" json:"cover_image"`
	Description string        `bson:"description" json:"description"`
}

func (*Movies) FindAllMovies

func (m *Movies) FindAllMovies() ([]Movies, error)

func (*Movies) FindMovieById

func (m *Movies) FindMovieById(id string) (Movies, error)

func (*Movies) InsertMovie

func (m *Movies) InsertMovie(movie Movies) error

func (*Movies) RemoveMovie

func (m *Movies) RemoveMovie(id string) error

func (*Movies) UpdateMovie

func (m *Movies) UpdateMovie(movie Movies) error

type User

type User struct {
	UserName string `bson:"username" json:"username"`
	Password string `bson:"password" json:"password"`
}

Jump to

Keyboard shortcuts

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