{"id":28613851,"url":"https://github.com/doganarif/GoVisual","last_synced_at":"2025-06-12T01:04:05.352Z","repository":{"id":291348098,"uuid":"977356087","full_name":"doganarif/GoVisual","owner":"doganarif","description":"Zero-config, pure-Go HTTP request visualizer \u0026 debugger for local Go web development.","archived":false,"fork":false,"pushed_at":"2025-05-20T09:32:35.000Z","size":618,"stargazers_count":600,"open_issues_count":6,"forks_count":22,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-06-09T07:58:09.217Z","etag":null,"topics":["golang","logging","networking","opentelemetry","opentelemetry-go"],"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/doganarif.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":"LICENSE.md","code_of_conduct":"docs/code-of-conduct.md","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":"2025-05-04T02:29:54.000Z","updated_at":"2025-06-08T19:58:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"95bdfb3d-722d-4a13-8c12-263eb3061e9b","html_url":"https://github.com/doganarif/GoVisual","commit_stats":null,"previous_names":["doganarif/govisual"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/doganarif/GoVisual","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doganarif%2FGoVisual","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doganarif%2FGoVisual/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doganarif%2FGoVisual/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doganarif%2FGoVisual/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doganarif","download_url":"https://codeload.github.com/doganarif/GoVisual/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doganarif%2FGoVisual/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259374698,"owners_count":22847854,"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":["golang","logging","networking","opentelemetry","opentelemetry-go"],"created_at":"2025-06-12T01:01:51.094Z","updated_at":"2025-06-12T01:04:05.332Z","avatar_url":"https://github.com/doganarif.png","language":"Go","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# GoVisual\n\nA lightweight, zero-configuration HTTP request visualizer and debugger for Go web applications during local development.\n\n## Features\n\n- **Real-time Request Monitoring**: Visualize HTTP requests passing through your application\n- **Request Inspection**: Deep inspection of headers, body, status codes, and timing information\n- **Middleware Tracing**: Visualize middleware execution flow and identify performance bottlenecks\n- **Zero Configuration**: Drop-in integration with standard Go HTTP handlers\n- **OpenTelemetry Integration**: Optional export of telemetry data to OpenTelemetry collectors\n\n## Installation\n\n```bash\ngo get github.com/doganarif/govisual\n```\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n    \"net/http\"\n    \"github.com/doganarif/govisual\"\n)\n\nfunc main() {\n    mux := http.NewServeMux()\n\n    // Add your routes\n    mux.HandleFunc(\"/api/users\", userHandler)\n\n    // Wrap with GoVisual\n    handler := govisual.Wrap(\n        mux,\n        govisual.WithRequestBodyLogging(true),\n        govisual.WithResponseBodyLogging(true),\n    )\n\n    http.ListenAndServe(\":8080\", handler)\n}\n```\n\nAccess the dashboard at `http://localhost:8080/__viz`\n\n## Documentation\n\nFor detailed documentation, please refer to the [DOCS](docs/README.md).\n\n## Configuration Options\n\n```go\nhandler := govisual.Wrap(\n    mux,\n    govisual.WithMaxRequests(100),              // Number of requests to store\n    govisual.WithDashboardPath(\"/__dashboard\"), // Custom dashboard path\n    govisual.WithRequestBodyLogging(true),      // Log request bodies\n    govisual.WithResponseBodyLogging(true),     // Log response bodies\n    govisual.WithIgnorePaths(\"/health\"),        // Paths to ignore\n    govisual.WithOpenTelemetry(true),           // Enable OpenTelemetry\n    govisual.WithServiceName(\"my-service\"),     // Service name for OTel\n    govisual.WithServiceVersion(\"1.0.0\"),       // Service version\n    govisual.WithOTelEndpoint(\"localhost:4317\"), // OTLP endpoint\n\n    // Storage options (choose one)\n    govisual.WithMemoryStorage(),                // In-memory storage (default)\n    govisual.WithPostgresStorage(               // PostgreSQL storage\n        \"postgres://user:password@localhost:5432/database?sslmode=disable\",\n        \"govisual_requests\"                     // Table name\n    ),\n    govisual.WithRedisStorage(                  // Redis storage\n        \"redis://localhost:6379/0\",             // Redis connection string\n        86400                                   // TTL in seconds (24 hours)\n    ),\n)\n```\n\n## Storage Backends\n\nGoVisual supports multiple storage backends for storing request logs:\n\n### In-Memory Storage (Default)\n\nThe default storage keeps all request logs in memory. This is the simplest option but logs will be lost when the application restarts.\n\n```go\nhandler := govisual.Wrap(\n    mux,\n    govisual.WithMemoryStorage(), // Optional, this is the default\n)\n```\n\n### PostgreSQL Storage\n\nFor persistent storage, you can use PostgreSQL. This requires the `github.com/lib/pq` package.\n\n```go\nhandler := govisual.Wrap(\n    mux,\n    govisual.WithPostgresStorage(\n        \"postgres://user:password@localhost:5432/dbname?sslmode=disable\", // Connection string\n        \"govisual_requests\"  // Table name (created automatically if it doesn't exist)\n    ),\n)\n```\n\n### Redis Storage\n\nFor high-performance storage with automatic expiration, you can use Redis. This requires the `github.com/go-redis/redis/v8` package.\n\n```go\nhandler := govisual.Wrap(\n    mux,\n    govisual.WithRedisStorage(\n        \"redis://localhost:6379/0\", // Redis connection string\n        86400                       // TTL in seconds (24 hours)\n    ),\n)\n```\n\n## SQLite Driver Conflict\n\nIf you're already using a SQLite driver in your application (such as `github.com/mattn/go-sqlite3`), you may experience a conflict when using govisual with SQLite storage:\n\n```\npanic: sql: Register called twice for driver sqlite3\n```\n\nThis occurs because both your application and govisual try to register the SQLite driver with the same name.\n\nTo resolve this issue, you can pass your existing database connection to govisual:\n\n```go\nimport (\n    \"database/sql\"\n\n    \"github.com/doganarif/govisual\"\n    _ \"github.com/mattn/go-sqlite3\" // Your preferred SQLite driver\n)\n\nfunc main() {\n    // Create your own database connection\n    db, err := sql.Open(\"sqlite3\", \"path/to/your/database.db\")\n    if err != nil {\n        // Handle error\n    }\n    defer db.Close()\n\n    // Pass the existing connection to govisual\n    app := gin.New()\n    visualHandler := govisual.Wrap(\n        app,\n        govisual.WithSQLiteStorageDB(db, \"govisual_requests\"),\n    )\n\n    // Use visualHandler as your main handler\n    http.ListenAndServe(\":8080\", visualHandler)\n}\n```\n\nThis approach allows you to:\n\n1. Use your preferred SQLite driver\n2. Avoid driver registration conflicts\n3. Reuse your existing connection\n\n## Examples\n\n### Basic Example\n\nSimple example showing core functionalities:\n\n```bash\ncd cmd/examples/basic\ngo run main.go\n```\n\n### OpenTelemetry Example\n\nExample showing integration with OpenTelemetry:\n\n```bash\ncd cmd/examples/otel\ndocker-compose up -d  # Start Jaeger\ngo run main.go\n```\n\n### Multi-Storage Example\n\nExample showing different storage backends:\n\n```bash\ncd cmd/examples/multistorage\ndocker-compose up -d  # Start PostgreSQL and Redis\n```\n\nModify the environment variables in `docker-compose.yml` to switch between storage backends.\n\nVisit [Multi-Storage Example](cmd/examples/multistorage/README.md) for detailed instructions.\n\n## Dashboard Features\n\n![GoVisual Dashboard](docs/dashboard.png)\n\n- **Request Table**: View all captured HTTP requests with method, path, status code, and response time\n- **Request Details**: One-click access to headers, body content, and timing information\n- **Middleware Trace**: Interactive visualization of middleware execution flow\n- **Request Filtering**: Filter by HTTP method, status code, path pattern, or duration\n- **Real-time Updates**: See new requests appear instantly as they happen\n\n## License\n\nMIT License\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoganarif%2FGoVisual","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoganarif%2FGoVisual","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoganarif%2FGoVisual/lists"}