Esempio n. 1
0
// GetSave saves a record to the database
func GetSave(host, token, collection, id, value string) (*map[string]interface{}, error) {
	path := variables.APIPathGetSave
	path = strings.Replace(path, ":collection", collection, 1)
	path = strings.Replace(path, ":id", id, 1)
	path = strings.Replace(path, ":value", value, 1)
	return easyreq.GenericRequest(host, path, token, nil)
}
Esempio n. 2
0
File: auth.go Progetto: pdxjohnny/s
// LoginAuth logs in a user
func LoginAuth(host, token string, doc map[string]interface{}) (*map[string]interface{}, error) {
	path := variables.APIPathLoginAuth
	return easyreq.GenericRequest(host, path, token, doc)
}
Esempio n. 3
0
File: auth.go Progetto: pdxjohnny/s
// RefreshAuth gets a new toke for the user
func RefreshAuth(host, token string) (*map[string]interface{}, error) {
	path := variables.APIPathRefreshAuth
	return easyreq.GenericRequest(host, path, token, nil)
}
Esempio n. 4
0
File: end.go Progetto: pdxjohnny/eco
// End ends a call that has been started provided you have the lock
func End(host, token, lock string) (*map[string]interface{}, error) {
	path := variables.APIPathEnd
	path = strings.Replace(path, ":lock", lock, 1)
	return easyreq.GenericRequest(host, path, token, nil)
}
Esempio n. 5
0
// Call makes a call to a number and returns a lock
func Call(host, token, number string) (*map[string]interface{}, error) {
	path := variables.APIPathCall
	path = strings.Replace(path, ":number", number, 1)
	return easyreq.GenericRequest(host, path, token, nil)
}
Esempio n. 6
0
// Near preforms a geospacial query to find things near a point
func Near(host, token, collection string, doc map[string]interface{}) (*map[string]interface{}, error) {
	path := variables.APIPathNear
	path = strings.Replace(path, ":collection", collection, 1)
	return easyreq.GenericRequest(host, path, token, doc)
}