models

package
v0.0.0-...-2529ea7 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: Apache-2.0 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

FindAll records from the DB

func FindOne

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

FindOne record from the DB

func Insert

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

Insert a data to the DB

func Remove

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

Remove records from the DB

func Update

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

Update records from the DB

Types

type Application

type Application struct {
	ID          bson.ObjectId `bson:"_id" json:"id"`
	Name        string        `bson:"name" json:"name"`
	Type        string        `bson:"app_type" json:"app_type"`
	Description string        `bson:"description" json:"description"`
}

Application Model

func (*Application) FindAllApplication

func (m *Application) FindAllApplication() ([]Application, error)

FindAllApplication from the DB

func (*Application) FindAppByID

func (m *Application) FindAppByID(id string) (Application, error)

FindAppByID from the DB

func (*Application) InsertApplication

func (m *Application) InsertApplication(app Application) error

InsertApplication to the DB

func (*Application) RemoveApp

func (m *Application) RemoveApp(id string) error

RemoveApp is used for remove

func (*Application) UpdateApp

func (m *Application) UpdateApp(app Application) error

UpdateApp is used for update

Jump to

Keyboard shortcuts

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