Exemplo 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)
}
Exemplo n.º 2
0
Arquivo: auth.go Projeto: 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)
}
Exemplo n.º 3
0
Arquivo: auth.go Projeto: 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)
}
Exemplo n.º 4
0
Arquivo: end.go Projeto: 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)
}
Exemplo 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)
}
Exemplo 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)
}