db

package
v0.0.0-...-398b80c Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package db is a wrapper around the mgo package the app uses to communicate with the MongoDB database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseDB

func CloseDB()

CloseDB closes the app's connection with the database.

func CreateDot

func CreateDot(dot *models.Dot, dotbookID int)

CreateDot inserts a Dot object in the database

func CreateDotbook

func CreateDotbook(dotbook *models.Dotbook)

CreateDotbook inserts a Dotbook object in the database

func DeleteDotbook

func DeleteDotbook(id int) error

DeleteDotbook deletes a Dotbook from the database

func DotbookExists

func DotbookExists(name string) bool

DotbookExists returns a bool indicating whether or not a Dotbook with the given name is in the database

func GetAllDotbooks

func GetAllDotbooks() []*models.Dotbook

GetAllDotbooks queries the database and returns a Dotbook slice

func GetDotbook

func GetDotbook(id int) *models.Dotbook

GetDotbook retrieves a Dotbook object from the database via its id

func InitDB

func InitDB()

InitDB will open the app's connection to the database.

func UpdateDotbook

func UpdateDotbook(id int, dotbook *models.Dotbook) error

UpdateDotbook deletes a Dotbook from the database

Types

This section is empty.

Jump to

Keyboard shortcuts

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