service

package
v0.0.0-...-d1a64ea Latest Latest
Warning

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

Go to latest
Published: May 22, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package service contains all the services necessary for interacting with all the collections(tables) in the database.

Each service file should be written in it's own file and should represent only one dbmodels

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoIDSpecified says that no ID was specified for a fetch operation
	ErrNoIDSpecified = errors.New("No Id was specified for the entity")
)

Functions

func CloseDbService

func CloseDbService()

CloseDbService closes the current mongodb session

func Connect

func Connect(collectionName string) (*mgo.Session, *mgo.Collection)

Connect creates the connection to the database. To avoid forgetting to close the session, always write: *defer session.Close()* right after getting it through this method

func InitDbService

func InitDbService()

InitDbService initializes the connection (known as session) parameters to the database

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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