locations

package
v0.0.0-...-8b270be Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2015 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseSession

type DatabaseSession struct {
	*mgo.Session
	// contains filtered or unexported fields
}

func NewSession

func NewSession(name string) *DatabaseSession

Connect to the local MongoDB and set up the database.

func (*DatabaseSession) Database

func (session *DatabaseSession) Database(c *gin.Context)

http://blog.mongodb.org/post/80579086742/running-mongodb-queries-concurrently-with-go Request a socket connection from the session to process our query. Close the session when the goroutine exits and put the connection back into the pool.

type Location

type Location struct {
	Latitude float32 `json:"lat"`
}

type Server

type Server struct {
	*gin.Engine
}

func NewServer

func NewServer(session *DatabaseSession) Server

Create a new *martini.ClassicMartini server. We'll use a JSON renderer and our MongoDB database handler. We define two routes: "GET /signatures" and "POST /signatures".

Jump to

Keyboard shortcuts

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