{"id":15061767,"url":"https://github.com/nullswan/gin-api-replay-usage","last_synced_at":"2026-01-03T11:06:41.382Z","repository":{"id":144257297,"uuid":"358717928","full_name":"nullswan/gin-api-replay-usage","owner":"nullswan","description":"Gin middleware that export important data from passed request and process them in a passed function.","archived":false,"fork":false,"pushed_at":"2021-05-04T14:27:33.000Z","size":7,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T02:14:59.451Z","etag":null,"topics":["gin","gin-api","gin-middleware","go","golang"],"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/nullswan.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}},"created_at":"2021-04-16T20:57:26.000Z","updated_at":"2022-07-12T14:07:07.000Z","dependencies_parsed_at":"2023-07-11T22:01:19.672Z","dependency_job_id":null,"html_url":"https://github.com/nullswan/gin-api-replay-usage","commit_stats":null,"previous_names":["nullswan/gin-api-replay-usage","c3b5aw/gin-api-replay-usage"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullswan%2Fgin-api-replay-usage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullswan%2Fgin-api-replay-usage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullswan%2Fgin-api-replay-usage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullswan%2Fgin-api-replay-usage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nullswan","download_url":"https://codeload.github.com/nullswan/gin-api-replay-usage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243723166,"owners_count":20337324,"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":["gin","gin-api","gin-middleware","go","golang"],"created_at":"2024-09-24T23:24:53.700Z","updated_at":"2026-01-03T11:06:41.355Z","avatar_url":"https://github.com/nullswan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gin-api-replay-usage\n\nSee examples for passing func to tearDown, can be used to save document in (any) database or direct parsing through rpcx.\n\nErrors Assertion:\\\nError field is automatically set when response is different from 301 (Redirection) and 200 (Success)\nError_msg is set when you return error in your body.\n\n```\ntype ResponseError struct {\n\tCode    int    `json:\"code\"`\n\tMessage string `json:\"message\"`\n}\n\n{\n\t\"code\": 404,\n\t\"error\": \"not found\"\n}\n```\n\n\n## Example returned typed Struct\n```\ntype ReplayData struct {\n\tTime                    int64\n\tHost, Path, Method, URL string\n\tStatus_code             int\n\tError                   bool\n\tError_msg               string\n\tClient                  struct {\n\t\tReferer, Authorization, Origin, Remote_address, User_agent, Platform, Browser string\n\t}\n\tRequest struct {\n\t\tProcess_time, Content_length int64\n\t\tMimetype, Body               string\n\t\tHeaders                      map[string]string\n\t\tArgs                         map[string][]string\n\t}\n\tResponse struct {\n\t\tContent_length int\n\t\tMimetype, Body string\n\t\tHeaders        map[string][]string\n\t}\n}\n```\n\n## Example Output Document\n```\n{\n\t\t\"Time\": 1618606390449228744,\n\t\t\"Host\": \"localhost:3000\",\n\t\t\"Path\": \"/stars\",\n\t\t\"Method\": \"GET\",\n\t\t\"URL\": \"localhost:3000\",\n\t\t\"Status_code\": 200,\n\t\t\"Error\": false,\n\t\t\"Error_msg\": \"some error msg if any\",\n\t\t\"Client\": {\n\t\t\t\t\"Referer\": \"some ref if any\",\n\t\t\t\t\"Authorization\": \"Bearer Authorization\",\n\t\t\t\t\"Origin\": \"some origin if any\",\n\t\t\t\t\"Remote_address\": \"::1\",\n\t\t\t\t\"User_agent\": \"Mozilla/5.0 ... (Truncated Manually)\",\n\t\t\t\t\"Platform\": \"\",\n\t\t\t\t\"Browser\": \"\"\n\t\t},\n\t\t\"Request\": {\n\t\t\t\t\"Process_time\": 9496,\n\t\t\t\t\"Content_length\": 38,\n\t\t\t\t\"Mimetype\": \"application/json\",\n\t\t\t\t\"Body\": \"{\"username\": \"usr\", \"password\": \"pwd\"}\",\n\t\t\t\t\"Headers\": {\n\t\t\t\t\t\"Upgrade-Insecure-Requests\" : \"1\",\n\t\t\t\t\t\"Cache-Control\" : \"max-age=0\",\n\t\t\t\t\t\"Accept\" : \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\",\n\t\t\t\t\t\"Accept-Language\" : \"en-US,en;q=0.5\",\n\t\t\t\t\t\"Accept-Encoding\" : \"gzip, deflate\",\n\t\t\t\t\t\"Connection\" : \"keep-alive\"\n\t\t\t\t\t\"User-Agent\": \"Mozilla/5.0 ... (Truncated Manually)\",\n\t\t\t\t},\n\t\t\t\t\"Args\": {\n\t\t\t\t\t\"a\": [\n\t\t\t\t\t\t\"87\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t},\n\t\t\"Response\": {\n\t\t\t\t\"Content_length\": 6,\n\t\t\t\t\"Mimetype\": \"application/json; charset=utf-8\",\n\t\t\t\t\"Body\": \"\\\"pong\"\",\n\t\t\t\t\"Headers\": {\n\t\t\t\t\t\t\"Content-Type\": [\n\t\t\t\t\t\t\t\t\"application/json; charset=utf-8\"\n\t\t\t\t\t\t]\n\t\t\t\t}\n\t\t}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullswan%2Fgin-api-replay-usage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnullswan%2Fgin-api-replay-usage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullswan%2Fgin-api-replay-usage/lists"}