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 Open ¶
func Open() (*mgo.Database, error)
Open establishes a new session to the cluster identified by the given seed server(s). The session will enable communication with all of the servers in the cluster, so the seed servers are used only to find out about the cluster topology. It returns the mongodb session
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.