{"id":15372952,"url":"https://github.com/rs/xaccess","last_synced_at":"2025-04-15T12:32:15.473Z","repository":{"id":57481150,"uuid":"45002406","full_name":"rs/xaccess","owner":"rs","description":"Go http handler access logger","archived":false,"fork":false,"pushed_at":"2016-08-03T17:08:26.000Z","size":7,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-01T10:42:13.075Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/rs.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}},"created_at":"2015-10-26T22:52:07.000Z","updated_at":"2020-10-21T06:32:57.000Z","dependencies_parsed_at":"2022-09-26T17:41:19.167Z","dependency_job_id":null,"html_url":"https://github.com/rs/xaccess","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Fxaccess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Fxaccess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Fxaccess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Fxaccess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rs","download_url":"https://codeload.github.com/rs/xaccess/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223673051,"owners_count":17183618,"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":[],"created_at":"2024-10-01T13:53:49.761Z","updated_at":"2024-11-08T11:03:59.557Z","avatar_url":"https://github.com/rs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go HTTP Handler Access Log\n\n[![godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/rs/xaccess) [![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/rs/xaccess/master/LICENSE) [![Build Status](https://travis-ci.org/rs/xaccess.svg)](https://travis-ci.org/rs/xaccess) [![Coverage](http://gocover.io/_badge/github.com/rs/xaccess)](http://gocover.io/github.com/rs/xaccess)\n\nPackage xaccess is a middleware that logs all access requests performed on the sub handler using [xlog](https://github.com/rs/xlog) and [xstats](https://github.com/rs/xstats) stored in context if any.\n\n## Usage\n\n```go\nc := xhandler.Chain{}\n\nc.UseC(xlog.NewHandler(xlog.Config{}))\nc.UseC(xstats.NewHandler(dogstatsd.New(statsdWriter, flushInterval), tags))\n\nc.UseC(xaccess.NewHandler())\n\nhttp.Handle(\"/\", c.Handler(xhandler.HandlerFuncC(func(ctx context.Context, w http.ResponseWriter, r *http.Request) {\n    w.Write([]byte(\"Hello World\"))\n})))\n\nif err := http.ListenAndServe(\":8080\", nil); err != nil {\n    log.Fatal(err)\n}\n```\n\n## Licenses\n\nAll source code is licensed under the [MIT License](https://raw.github.com/rs/xlog/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frs%2Fxaccess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frs%2Fxaccess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frs%2Fxaccess/lists"}