kezban

package module
Version: v0.0.0-...-7af61db Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2017 License: MIT Imports: 6 Imported by: 2

README

Kezban

The most grumpy ODM package for MongoDB in GO.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APPNAME string
View Source
var Database *mgo.Session = nil

Functions

func FillStruct

func FillStruct(s interface{}, m map[string]interface{}) error

func GetFields

func GetFields(model interface{}, search string) map[string]interface{}

func Initialize

func Initialize(uri string, appname string) error

func ReadTagAndValue

func ReadTagAndValue(val interface{})

func ToBSON

func ToBSON(doc interface{}) (bsonData bson.M, err error)

Types

type KezQu

type KezQu struct {
	Query interface{}
	Limit int
}

type Model

type Model struct {
	Id        bson.ObjectId `bson:"_id,omitempty" json:"id"`
	CreatedAt time.Time     `json:"created_at" bson:"created_at,omitempty"`
	UpdatedAt time.Time     `json:"updated_at" bson:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Model) Delete

func (self *Model) Delete() (err error)

func (*Model) Find

func (self *Model) Find(q bson.M) *mgo.Query

func (*Model) FindAll

func (self *Model) FindAll(query KezQu, models interface{}) error

* @param query for specific filters * @param models needs to be pointer of model array * @return err

func (*Model) FindOne

func (self *Model) FindOne(query interface{}, model interface{}) (err error)

func (*Model) Remove

func (self *Model) Remove(query interface{}) (err error)

func (*Model) Save

func (self *Model) Save() (*Model, error)

func (*Model) Search

func (self *Model) Search(query KezQu, indexes []string, models interface{}) error

func (*Model) SetItself

func (self *Model) SetItself(model interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL