// 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) }
// 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) }
// 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) }
// 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) }
// 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) }
// 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) }