handler

package
v0.0.0-...-c93c29d Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package handler provides primitives for handling the mongo db queries collections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckLongUrl

func CheckLongUrl(connection *mgo.Collection, longUrl string) (error, models.UrlInfo)

func CheckShortUrl

func CheckShortUrl(connection *mgo.Collection, shortUrl string) (error, models.UrlInfo)

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 Fetch

func Fetch(connection *mgo.Collection) (error, []models.UrlInfo)

func InsertUrlInfo

func InsertUrlInfo(connection *mgo.Collection, longUrl string, shortUrl string) error

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.

Jump to

Keyboard shortcuts

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