{"id":15187294,"url":"https://github.com/e19166/simulator","last_synced_at":"2026-01-31T23:06:24.696Z","repository":{"id":257534242,"uuid":"858535423","full_name":"e19166/Simulator","owner":"e19166","description":" A event management simulator that integrates a PostgreSQL database with a Go backend. This application allows users to create and manage event records via HTTP endpoints. The project uses Gorilla Mux for routing, and the database operations are handled with Go's database/sql package and the PostgreSQL driver. ","archived":false,"fork":false,"pushed_at":"2024-09-19T01:23:21.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T08:20:32.324Z","etag":null,"topics":["backend","crud","database","database-migrations","gin","gin-gonic","go","golang","http","postgresql","postgresql-driver","postman","programming","project-management","routing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/e19166.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-09-17T04:26:49.000Z","updated_at":"2025-01-29T16:40:33.000Z","dependencies_parsed_at":"2024-09-17T08:41:40.643Z","dependency_job_id":"59f93434-6c3e-4519-96fc-236d4544ab42","html_url":"https://github.com/e19166/Simulator","commit_stats":null,"previous_names":["e19166/simulator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e19166%2FSimulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e19166%2FSimulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e19166%2FSimulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e19166%2FSimulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/e19166","download_url":"https://codeload.github.com/e19166/Simulator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240815817,"owners_count":19862149,"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":["backend","crud","database","database-migrations","gin","gin-gonic","go","golang","http","postgresql","postgresql-driver","postman","programming","project-management","routing"],"created_at":"2024-09-27T18:09:16.103Z","updated_at":"2026-01-31T23:06:24.667Z","avatar_url":"https://github.com/e19166.png","language":"Go","readme":"# Simulator\n\nA Go-based event management simulator with PostgreSQL integration. This application provides a RESTful API to create and manage event records.\n\n## Features\n\n- **Database Integration**: Connects to a PostgreSQL database using Go's `database/sql` package.\n- **Event Management**: Allows the creation of event records via a RESTful API endpoint.\n- **Routing**: Uses Gorilla Mux for handling HTTP routes.\n\n## Getting Started\n\n### Prerequisites\n\n- Go 1.18 or later\n- PostgreSQL\n- Gorilla Mux (`github.com/gorilla/mux`)\n- PostgreSQL Driver (`github.com/lib/pq`)\n\n### Installation\n\n1. **Clone the Repository:**\n\n```sh\n   git clone https://github.com/e19166/Simulator.git\n   cd Simulator\n```\n\n2.**Install Dependencies:**\n\n```sh\n  go mod tidy\n```\n\n3. **Set Up the Database:**\n\n * Ensure PostgreSQL is installed and running.\n * Create a database and a **projects** table with the appropriate schema.\n\n4. **Configure Database Connection:**\n\n * Update the connection string in **db/init.go** to match your PostgreSQL setup.\n\n5. **Run the Application:**\n\n```sh\n  go run main.go\n```\n  The server will start on port 8080.\n\n### API Endpoints\n\n* **POST /projects**\n\n  Create a new event.\n\n  **Request Body Example:**\n\n  ```json\n  {\n  \"Metadata\": {\n    \"Name\": \"Event Alpha\",\n    \"Labels\": {\n      \"Environment\": \"production\",\n      \"Type\": \"web\"\n    },\n    \"Annotations\": {\n      \"MonitoringType\": \"full\"\n    },\n    \"DeletionTimestamp\": \"2024-01-01T00:00:00Z\",\n    \"Reason\": \"Initial creation\",\n    \"Message\": \"This is a test event\"\n  },\n  \"ApiVersion\": \"v1\",\n  \"Kind\": \"project\",\n  \"InvolvedObject\": {\n    \"Name\": \"Object1\",\n    \"Uuid\": \"123e4567-e89b-12d3-a456-426614174000\",\n    \"Version\": \"v1\"\n  },\n  \"Action\": \"create\",\n  \"EventTime\": \"2024-01-01T00:00:00Z\",\n  \"Source\": {\n    \"Component\": \"component1\",\n    \"Host\": \"host1\"\n  },\n  \"Count\": 1,\n  \"Outcome\": \"success\",\n  \"CurrentStatus\": \"active\",\n  \"CorrelationID\": \"correlation-123\",\n  \"UserIdpId\": \"user-123\",\n  \"OrgUuid\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"Series\": {\n    \"FirstTimestamp\": \"2024-01-01T00:00:00Z\",\n    \"LastTimestamp\": \"2024-01-01T00:00:00Z\",\n    \"State\": \"running\"\n  }}\n  ```\n  \n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe19166%2Fsimulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fe19166%2Fsimulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe19166%2Fsimulator/lists"}