bikend

command module
v0.0.0-...-7d2ef97 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2015 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

BikeDrop system

Installation

It's quite simple with some container magic. Default configuration is HAProxy loadbalancing on Web applications (powered by Go) that provide REST API for frontend (Angularjs/Ionic framework) and also are deploying it. Database persistence is kept via MongoDB, mapping services provided by ESRI. Authentication done via Facebook OAuth.

Use docker compose

docker-compose up

deploy it on Tutum

Deploy to Tutum

Install locally

Dependencies managed through glide

brew install glide

Install packages

glide up

Use vendor experiment

GO15VENDOREXPERIMENT=1

Build it

go build

Run it

./bikend

API reference (incomplete)

add new user: POST /api/users

{
    "userID": "karolis@rusenas4.com",
    "profilePic": "http://somehwere",
    "firstName": "karolis",
    "lastName": "rusenas"
}

get all users: GET /api/users

{
	"data": [{
		"id": "5663430637dd12e2022d258d",
		"bikeLocation": {
			"id": "",
			"host": "",
			"space": 0,
			"active": false,
			"long": 0,
			"lat": 0,
			"bookings": null
		},
		"userID": "karolis@rusenas2.com",
		"profilePic": "http://somehwere",
		"firstName": "karolis",
		"lastName": "rusenas"
	}, {
		"id": "566346a337dd12f268241c0c",
		"bikeLocation": {
			"id": "",
			"host": "",
			"space": 0,
			"active": false,
			"long": 0,
			"lat": 0,
			"bookings": null
		},
		"userID": "karolis@rusenas4.com",
		"profilePic": "http://somehwere",
		"firstName": "karolis",
		"lastName": "rusenas"
	}]
}

get specific user: GET /api/users?q=karolis@rusenas4.com

{
	"data": {
		"id": "566346a337dd12f268241c0c",
		"hostingPlaces": [{
			"id": "56635db837dd121ce8f0b257",
			"host": "karolis@rusenas4.com",
			"space": 3,
			"active": true,
			"long": 0,
			"lat": 0,
			"bookings": []
		}],
		"bikeLocation": {
			"id": "",
			"host": "",
			"space": 0,
			"active": false,
			"long": 0,
			"lat": 0,
			"bookings": null
		},
		"userID": "karolis@rusenas4.com",
		"profilePic": "http://somehwere",
		"firstName": "karolis",
		"lastName": "rusenas"
	}
}

add new hosting place: POST /api/places

{
    "host": "karolis@rusenas4.com",
    "space": 3,
    "long": "44.44",
    "lat": "32.23",
    "address": "string here",
     "active": true,
}

add new booking: POST /api/bookings

{
    "host": "karolis@rusenas4.com",
    "user": "karolis@rusenas2.com",
}

get booking: GET /api/bookings?user=user@email.com

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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