{"id":21558171,"url":"https://github.com/makepad-fr/gam","last_synced_at":"2025-10-25T03:31:41.140Z","repository":{"id":245278889,"uuid":"817777085","full_name":"Makepad-fr/gam","owner":"Makepad-fr","description":"An analytics middleware for Go web servers","archived":false,"fork":false,"pushed_at":"2024-06-21T11:49:48.000Z","size":29,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T04:41:58.691Z","etag":null,"topics":["analytics","go","http","library","middleware"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/Makepad-fr/gam","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Makepad-fr.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}},"created_at":"2024-06-20T12:20:11.000Z","updated_at":"2024-06-21T12:03:09.000Z","dependencies_parsed_at":"2024-06-21T04:21:46.140Z","dependency_job_id":"75c8c7cd-0dbb-47a2-aaf9-10032349ca28","html_url":"https://github.com/Makepad-fr/gam","commit_stats":null,"previous_names":["makepad-fr/gam"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Makepad-fr%2Fgam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Makepad-fr%2Fgam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Makepad-fr%2Fgam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Makepad-fr%2Fgam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Makepad-fr","download_url":"https://codeload.github.com/Makepad-fr/gam/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244149198,"owners_count":20406331,"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":["analytics","go","http","library","middleware"],"created_at":"2024-11-24T08:14:10.929Z","updated_at":"2025-10-25T03:31:41.083Z","avatar_url":"https://github.com/Makepad-fr.png","language":"Go","readme":"# gam\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/Makepad-fr/gam.svg)](https://pkg.go.dev/github.com/Makepad-fr/gam)\n[![Go Report Card](https://goreportcard.com/badge/github.com/Makepad-fr/gam)](https://goreportcard.com/report/github.com/Makepad-fr/gam)\n\nAn analytics middleware for Go web servers\n\n## Install\n\n\n**TIP:** If you want to use a specific version please refer [releases](https://github.com/Makepad-fr/gam/releases) and replace `latest` with the desired version.\n\n```bash\ngo get -u https://github.com/Makepad-fr/gam@latest\n```\n\n## Usage\n\nFirst create a new instance of gam by using the [`gam.Init` function](https://pkg.go.dev/github.com/Makepad-fr/gam#Init)\n\n```go\ng, err := gam.Init(\"ch_username\", \"ch_password\", \"ch_hostname\", \"ch_port\", \"ch_database_name\", \"ch_table_name\", true, true)\n```\n\nThis will return an error if there's a connection issue or if the table names `ch_table_name` exists but have a different schema then the [expected schema](https://github.com/Makepad-fr/gam/blob/v1.0.0-rc5/db.go#L11-L45). Otherwise it will create an table named `ch_table_name` if it does not exists yet.\n\nThen pass your handler function to the `g.Middleware` as you'd done with any middleware functions in go\n\n```go\nh := g.Middleware(myHandlerFunc)\n```\n\nIt will create you a `http.Handler` that you can pass to a `http.ServerMux` or `http.Server` using `Handle` method\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakepad-fr%2Fgam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakepad-fr%2Fgam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakepad-fr%2Fgam/lists"}