Documentation
¶
Overview ¶
Package handler provides primitives for handling the mongo db queries collections.
Index ¶
- func CheckLongUrl(connection *mgo.Collection, longUrl string) (error, models.UrlInfo)
- func CheckShortUrl(connection *mgo.Collection, shortUrl string) (error, models.UrlInfo)
- func CreateUrlIndex(connection *mgo.Collection)
- func Fetch(connection *mgo.Collection) (error, []models.UrlInfo)
- func InsertUrlInfo(connection *mgo.Collection, longUrl string, shortUrl string) error
- func Open() (*mgo.Database, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckLongUrl ¶
func CheckShortUrl ¶
func CreateUrlIndex ¶
func CreateUrlIndex(connection *mgo.Collection)
Allows to create a index for the date filed in mongodb db.getCollection('tblShortUrl').getIndices({}) List all indexes on all collections in a database
func InsertUrlInfo ¶
func InsertUrlInfo(connection *mgo.Collection, longUrl string, shortUrl string) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.