{"id":22683238,"url":"https://github.com/mtchavez/roxy","last_synced_at":"2025-03-29T14:27:53.893Z","repository":{"id":8467404,"uuid":"10066109","full_name":"mtchavez/roxy","owner":"mtchavez","description":"Riak Proxy in Go","archived":false,"fork":false,"pushed_at":"2013-07-30T01:06:31.000Z","size":317,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-04T15:32:31.929Z","etag":null,"topics":["go","proxy","riak","riak-proxy"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ajainvivek/P2PSignalling","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mtchavez.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-14T22:16:25.000Z","updated_at":"2017-03-08T16:38:52.000Z","dependencies_parsed_at":"2022-09-26T19:42:32.094Z","dependency_job_id":null,"html_url":"https://github.com/mtchavez/roxy","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Froxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Froxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Froxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Froxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtchavez","download_url":"https://codeload.github.com/mtchavez/roxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246195615,"owners_count":20738908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","proxy","riak","riak-proxy"],"created_at":"2024-12-09T21:11:20.995Z","updated_at":"2025-03-29T14:27:53.868Z","avatar_url":"https://github.com/mtchavez.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Roxy\n\n#### A Riak Proxy\nA proxy between your client and Riak. Harnesses Go routines and a pool of connections to\nRiak to handle your queries to Riak.\n\n## Install\n\n```\ngo get -u github.com/mtchavez/roxy\n```\n\n## Usage\n\n### Configuration\nRoxy uses a [toml](https://github.com/mojombo/toml) config file for settings. Here is an example config:\n\n```\ntitle = \"Roxy configuration TOML\"\n\n[roxy]\n  ip = \"127.0.0.1\"\n  port = 8088\n  p95 = 0.01\n  bg_procs = 10\n\n[riak]\n  ip = \"127.0.0.1\"\n  port = 8087\n  pool_size = 5\n\n[statsite]\n  enabled = false\n  ip = \"0.0.0.0\"\n  port = 8125\n```\n\n#### [roxy]\n\n* ```ip``` - IP you want Roxy to listen on\n* ```port``` - Port you want for Roxy to listen on\n* ```p95``` - Float number in milliseconds. Used to time out reads to Riak after\np95 time. Roxy will re-issue the read again and respond to the client.\n* ```bg_procs``` - Threshold of total number of background PutReq that can run at one time. Otherwise runs normally.\n\n#### [riak]\n\n* ```ip``` - IP to your Riak\n* ```port``` - Protocol Buffer Port for Riak\n* ```pool_size``` - Number of connections for Roxy to make to Riak for a connection pool\n\n#### [statsite]\n\n* ```enabled``` - true to enable tracing stats via statsite or false to turn off\n* ```ip``` - IP of statsite\n* ```port``` - Port of statsite\n\n### Starting a server\n\nStarting Roxy just takes a path to a toml config\n\n```go\npackage main\n\nimport \"github.com/mtchavez/roxy\"\n\nfunc main() {\n  roxy.Setup(\"./path/to/my-config.toml\")\n  roxy.RunProxy()\n}\n```\n\nThis will setup a ```net.Listener``` on the supplied ip and port from your config for\nRoxy to listen for new connections on.\n\n### Sending Requests\nIf you point your client to the Roxy ip and port you can now make regular Riak\nrequests as normal. A python example using the default Roxy ip and port would be:\n\n```python\nfrom riak import RiakClient, RiakPbcTransport, RiakObject\nimport simplejson\n\n\nhost = '127.0.0.1'\nport = 8088\nclient = RiakClient(host=host, port=port, transport_class=RiakPbcTransport, transport_options={'timeout': 10, 'max_attempts': 3})\n\nbucket = client.bucket('sample_bucket')\nfor i in xrange(1, 10):\n  obj = RiakObject(client, bucket, 'user_%d' % i)\n  obj._encode_data = False\n  obj.set_content_type(\"application/json\")\n  doc = {'name': 'John Smith', 'age': 28 + i, 'company': 'Mr. Startup!'}\n  obj.set_data(simplejson.dumps(doc))\n  obj.store(w=1)\n```\n\n## Documentation\n\nDocs can be found on [godoc](http://godoc.org/github.com/mtchavez/roxy/roxy) or\nrun ```go doc github.com/mtchavez/roxy``` locally\n\n## Test\n\nYou can run the tests using the Makefile with ```make test``` or\nusing ```go test``` in the roxy directory. This currently expects Riak to be running\nand available on default pb port ```8087```\n\n## TODO\n\n* p95 backup requests\n  - Currently turned off\n  - Need to figure out intermittent hanging when this is turned on\n\n## License\nWritten by Chavez\n\nReleased under the MIT License: http://www.opensource.org/licenses/mit-license.php\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtchavez%2Froxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtchavez%2Froxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtchavez%2Froxy/lists"}