예제 #1
0
파일: save.go 프로젝트: pdxjohnny/s-db
// 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)
}
예제 #2
0
파일: auth.go 프로젝트: 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)
}
예제 #3
0
파일: auth.go 프로젝트: 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)
}
예제 #4
0
파일: end.go 프로젝트: 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)
}
예제 #5
0
파일: call.go 프로젝트: pdxjohnny/eco
// 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)
}
예제 #6
0
파일: near.go 프로젝트: pdxjohnny/s-db
// 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)
}