modelApi

package
v0.0.0-...-23d2696 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: MIT, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAll

func DeleteAll(collectionName string, c *gin.Context) (er error)

func DeleteAllWitArray

func DeleteAllWitArray(collectionName string, ids []string) (er error)

func DeleteOne

func DeleteOne(collectionName string, c *gin.Context) (er error)

func DeleteOneWithString

func DeleteOneWithString(collectionName string, id string) (er error)

func FetchById

func FetchById(collectionName string, c *gin.Context, dbHandler func(*mgo.Query) (interface{}, error)) (uu interface{}, er error)

func FetchByIdWithMap

func FetchByIdWithMap(collectionName string, c map[string]string, dbHandler func(*mgo.Query) (interface{}, error)) (uu interface{}, er error)

func FetchOne

func FetchOne(collectionName string, c *gin.Context, dbHandler func(*mgo.Query) (interface{}, error)) (uu interface{}, er error)

func FetchOneWithMap

func FetchOneWithMap(collectionName string, c map[string]string, dbHandler func(*mgo.Query) (interface{}, error)) (uu interface{}, er error)

func InsertAll

func InsertAll(collectionName string, dbHandler func(*mgo.Collection) (interface{}, error)) (uu interface{}, er error)

func InsertOne

func InsertOne(collectionName string, dbHandler func(*mgo.Collection) (interface{}, error)) (uu interface{}, er error)

func ReplaceAll

func ReplaceAll(collectionName string, dbHandler func(*mgo.Collection) (interface{}, error)) (uu interface{}, er error)

func ReplaceOne

func ReplaceOne(collectionName string, dbHandler func(*mgo.Collection) (interface{}, error)) (uu interface{}, er error)

func Update

func Update(collectionName string, c *gin.Context, updatedValues map[string]interface{}, dbHandler func(*mgo.Collection, bson.M, bson.M) (interface{}, error)) (uu interface{}, er error)

func UpdateOneById

func UpdateOneById(collectionName string, c *gin.Context, updatedValues map[string]interface{}) (uu interface{}, er error)

func UpdateOneByIdString

func UpdateOneByIdString(collectionName string, id string, updatedValues map[string]interface{}) (uu interface{}, er error)

func UpdateWithMap

func UpdateWithMap(collectionName string, c map[string]string, updatedValues map[string]interface{}, dbHandler func(*mgo.Collection, bson.M, bson.M) (interface{}, error)) (uu interface{}, er error)

Types

type ApiModel

type ApiModel interface {
	DbFetchOne(*mgo.Query) (interface{}, error)
	DbInsertOne(*mgo.Collection) (interface{}, error)
	DbUpdateOne(*mgo.Collection, bson.M, bson.M) (interface{}, error)
	DbReplaceOne(*mgo.Collection) (interface{}, error)
	DbDeleteOne(*mgo.Collection) (interface{}, error)
}

type ApiModels

type ApiModels interface {
	DbFetchAll(*mgo.Query) (interface{}, error)
	DbInsertAll(*mgo.Collection) (interface{}, error)
	DbUpdateAll(*mgo.Collection, bson.M, bson.M) (interface{}, error)
	DbReplaceAll(*mgo.Collection) (interface{}, error)
	DbDeleteAll(*mgo.Collection) (interface{}, error)
}

type Result

type Result struct {
	URL   string      `json:"URL"`
	Data  interface{} `json:"Data"`
	Page  int64       `json:"Page"`
	Size  int64       `json:"Size"`
	Total int64       `json:"Total"`
}

func FetchAll

func FetchAll(collectionName string, c *gin.Context, dbHandler func(*mgo.Query) (interface{}, error)) (r Result, er error)

func FetchAllWithMap

func FetchAllWithMap(collectionName string, c map[string]string, dbHandler func(*mgo.Query) (interface{}, error)) (r Result, er error)

type Results

type Results []Result

Jump to

Keyboard shortcuts

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