{"id":34156513,"url":"https://github.com/jjmrocha/oblivion","last_synced_at":"2026-03-12T19:33:56.815Z","repository":{"id":240425576,"uuid":"799202282","full_name":"jjmrocha/oblivion","owner":"jjmrocha","description":"Oblivion is a Go-based playground project that implements a REST API for managing buckets and their associated keys and values","archived":false,"fork":false,"pushed_at":"2025-04-11T07:32:10.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-18T00:32:18.898Z","etag":null,"topics":["database","golang","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jjmrocha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-11T12:51:58.000Z","updated_at":"2025-05-15T16:27:36.000Z","dependencies_parsed_at":"2024-06-02T18:17:59.424Z","dependency_job_id":"f2388cd8-bcc3-4f2e-923c-152ea44ccb10","html_url":"https://github.com/jjmrocha/oblivion","commit_stats":null,"previous_names":["jjmrocha/oblivion"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jjmrocha/oblivion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjmrocha%2Foblivion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjmrocha%2Foblivion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjmrocha%2Foblivion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjmrocha%2Foblivion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jjmrocha","download_url":"https://codeload.github.com/jjmrocha/oblivion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjmrocha%2Foblivion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30439931,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["database","golang","rest-api"],"created_at":"2025-12-15T07:13:11.011Z","updated_at":"2026-03-12T19:33:56.800Z","avatar_url":"https://github.com/jjmrocha.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oblivion\n\nOblivion is a Go-based playground project that implements a REST API for managing buckets and their associated keys and values. The project demonstrates how to build a CRUD-based REST API using only Go's standard libraries and SQLite for data persistence.\n\n## Features\n\n- **Bucket Management**: Create, retrieve, list, and delete buckets.\n- **Key-Value Management**: Store, retrieve, update, and delete key-value pairs within buckets.\n- **Querying**: Search for keys based on criteria.\n- **Validation**: Input validation for bucket names, field names, and data types.\n- **Error Handling**: Structured error responses with HTTP status codes and error descriptions.\n\n## Project Structure\n\nThe project is organized into the following directories:\n\n- `api/`: Contains the REST API handlers and routing logic.\n- `bucket/`: Implements the business logic for bucket operations.\n- `httprouter/`: Provides a lightweight HTTP router and response utilities.\n- `model/`: Defines the data models used in the application.\n- `repo/`: Implements the repository layer for data persistence using SQLite.\n- `valid/`: Contains validation logic for input data.\n- `apperror/`: Defines application-specific error types and handling.\n\n## REST API Endpoints\n\n### Buckets\n\n#### List Buckets\n**GET** `/v1/buckets`\n\nResponse:\n```json\n[\n  \"bucket1\",\n  \"bucket2\"\n]\n```\n\n#### Create Bucket\n**POST** `/v1/buckets`\n\nRequest Body:\n```json\n{\n  \"name\": \"people\",\n  \"schema\": [\n    {\n      \"field\": \"id\",\n      \"type\": \"string\",\n      \"not-null\": true,\n      \"indexed\": true\n    },\n    {\n      \"field\": \"first_name\",\n      \"type\": \"string\",\n      \"not-null\": true,\n      \"indexed\": false\n    }\n  ]\n}\n```\n\nResponse:\n```json\n{\n  \"name\": \"people\",\n  \"schema\": [\n    {\n      \"field\": \"id\",\n      \"type\": \"string\",\n      \"not-null\": true,\n      \"indexed\": true\n    },\n    {\n      \"field\": \"first_name\",\n      \"type\": \"string\",\n      \"not-null\": true,\n      \"indexed\": false\n    }\n  ]\n}\n```\n\n#### Get Bucket\n**GET** `/v1/buckets/{bucket}`\n\nResponse:\n```json\n{\n  \"name\": \"people\",\n  \"schema\": [\n    {\n      \"field\": \"id\",\n      \"type\": \"string\",\n      \"not-null\": true,\n      \"indexed\": true\n    },\n    {\n      \"field\": \"first_name\",\n      \"type\": \"string\",\n      \"not-null\": true,\n      \"indexed\": false\n    }\n  ]\n}\n```\n\n#### Delete Bucket\n**DELETE** `/v1/buckets/{bucket}`\n\nResponse: `204 No Content`\n\n---\n\n### Keys\n\n#### Get Key\n**GET** `/v1/buckets/{bucket}/keys/{key}`\n\nResponse:\n```json\n{\n  \"id\": \"id1\",\n  \"first_name\": \"John\",\n  \"last_name\": \"Doe\"\n}\n```\n\n#### Set Key\n**PUT** `/v1/buckets/{bucket}/keys/{key}`\n\nRequest Body:\n```json\n{\n  \"id\": \"id1\",\n  \"first_name\": \"John\",\n  \"last_name\": \"Doe\"\n}\n```\n\nResponse: `204 No Content`\n\n#### Delete Key\n**DELETE** `/v1/buckets/{bucket}/keys/{key}`\n\nResponse: `204 No Content`\n\n#### Find Keys\n**GET** `/v1/buckets/{bucket}/keys?field=value`\n\nResponse:\n```json\n[\n  \"key1\",\n  \"key2\"\n]\n```\n\n## Running the Project\n\n1. Install Go (version 1.22 or later).\n2. Clone the repository:\n   ```sh\n   git clone https://github.com/jjmrocha/oblivion.git\n   cd oblivion\n   ```\n3. Run the application:\n   ```sh\n   go run main.go\n   ```\n4. The server will start on `http://localhost:9090`.\n\n## Testing the API\n\nYou can use the provided `test.http` file to test the API using tools like [REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) in Visual Studio Code.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjmrocha%2Foblivion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjmrocha%2Foblivion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjmrocha%2Foblivion/lists"}