{"id":21352429,"url":"https://github.com/sandwich-go/xtime","last_synced_at":"2025-06-23T10:37:20.131Z","repository":{"id":57660373,"uuid":"457647165","full_name":"sandwich-go/xtime","owner":"sandwich-go","description":"mock time","archived":false,"fork":false,"pushed_at":"2024-07-16T12:49:13.000Z","size":60,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"0.1/release","last_synced_at":"2025-04-07T00:28:01.024Z","etag":null,"topics":["golang","mock","testing","time"],"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/sandwich-go.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG-0.1.md","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,"zenodo":null}},"created_at":"2022-02-10T05:46:22.000Z","updated_at":"2024-07-16T12:49:06.000Z","dependencies_parsed_at":"2024-01-11T20:52:22.524Z","dependency_job_id":"fca6dcf0-3660-4368-a46b-ea1601b8c909","html_url":"https://github.com/sandwich-go/xtime","commit_stats":{"total_commits":16,"total_committers":3,"mean_commits":5.333333333333333,"dds":0.375,"last_synced_commit":"fa054b823e32612a41d1718d2deb5b6ee3e3dd24"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/sandwich-go/xtime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandwich-go%2Fxtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandwich-go%2Fxtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandwich-go%2Fxtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandwich-go%2Fxtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sandwich-go","download_url":"https://codeload.github.com/sandwich-go/xtime/tar.gz/refs/heads/0.1/release","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandwich-go%2Fxtime/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261463061,"owners_count":23162076,"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","mock","testing","time"],"created_at":"2024-11-22T03:13:38.386Z","updated_at":"2025-06-23T10:37:15.118Z","avatar_url":"https://github.com/sandwich-go.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xtime\n\n模拟Golang标准库Time接口，提供Freeze,Travel等功能。\n\nRun xtime Example: [![run on repl.it](https://repl.it/badge/github/timestee/XTime)](https://repl.it//@timestee/XTime#main.go)\n\n```golang\ntype Clock interface {\n\tAfter(d time.Duration) \u003c-chan time.Time\n\tNow() time.Time\n\tSince(t time.Time) time.Duration\n\tUntil(t time.Time) time.Duration\n\tSleep(d time.Duration)\n\tTick(d time.Duration) \u003c-chan time.Time\n\tNewTicker(d time.Duration) *MockTicker\n\tTimer(d time.Duration) *MockTimer\n\tAfterFunc(d time.Duration, f func()) *MockTimer\n\tWithDeadline(parent context.Context, d time.Time) (context.Context, context.CancelFunc)\n\tWithTimeout(parent context.Context, t time.Duration) (context.Context, context.CancelFunc)\n}\n\ntype Cop interface {\n\tFreeze(t time.Time)\n\tTravel(t time.Time)\n\tScale(scale float64)\n\tReturn()\n\tApplyOption(...Option) []Option\n}\n\ntype Mock interface {\n\tClock\n\tCop\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandwich-go%2Fxtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsandwich-go%2Fxtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandwich-go%2Fxtime/lists"}