{"id":42761688,"url":"https://github.com/gethiox/rotational-velocidensity-buffer","last_synced_at":"2026-02-21T13:05:05.151Z","repository":{"id":333752149,"uuid":"1137051565","full_name":"gethiox/rotational-velocidensity-buffer","owner":"gethiox","description":"Generic circular buffer implementation for Go with rotational velocidensity effect countermeasures.","archived":false,"fork":false,"pushed_at":"2026-01-20T21:24:38.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-30T07:29:47.211Z","etag":null,"topics":["circular-buffer","generic","go","ring-buffer"],"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/gethiox.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-18T20:31:32.000Z","updated_at":"2026-01-29T22:43:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gethiox/rotational-velocidensity-buffer","commit_stats":null,"previous_names":["gethiox/rotational-velocidensity-buffer"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gethiox/rotational-velocidensity-buffer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gethiox%2Frotational-velocidensity-buffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gethiox%2Frotational-velocidensity-buffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gethiox%2Frotational-velocidensity-buffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gethiox%2Frotational-velocidensity-buffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gethiox","download_url":"https://codeload.github.com/gethiox/rotational-velocidensity-buffer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gethiox%2Frotational-velocidensity-buffer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29681468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T12:30:22.644Z","status":"ssl_error","status_checked_at":"2026-02-21T12:29:55.402Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["circular-buffer","generic","go","ring-buffer"],"created_at":"2026-01-29T20:34:58.651Z","updated_at":"2026-02-21T13:05:05.146Z","avatar_url":"https://github.com/gethiox.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rotational Velocidensity Buffer\n[![GoDoc](https://godoc.org/github.com/gethiox/rotational-velocidensity-buffer?status.svg)](https://godoc.org/github.com/gethiox/rotational-velocidensity-buffer)\n[![Go Report Card](https://goreportcard.com/badge/github.com/gethiox/rotational-velocidensity-buffer)](https://goreportcard.com/report/github.com/gethiox/rotational-velocidensity-buffer)\n[![Tests](https://github.com/gethiox/rotational-velocidensity-buffer/actions/workflows/tests.yml/badge.svg)](https://github.com/gethiox/rotational-velocidensity-buffer/actions/workflows/tests.yml)\n\nRVB is a generic version of classical circular/ring buffer with a checkpoint support, which lets the user\naccess data from a fixed time point of view, especially useful for pagination of historical data.  \nThanks to [generics](https://go.dev/doc/tutorial/generics), user can conveniently define inner type that will be held by the buffer.\n\n### Minimum version requirement\n\nDue to usage of built-in `min()` and `max()` functions, minimum supported version is **[Go 1.21](https://go.dev/doc/go1.21)**.\n\n### Installation\n\n```shell\ngo get -v -u github.com/gethiox/rotational-velocidensity-buffer\n```\n\n### Example usage\n\n##### simple push and read\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"time\"\n\n    \"github.com/gethiox/rotational-velocidensity-buffer\"\n)\n\ntype ThingToStore struct {\n    ID   int\n    Text string\n}\n\nconst SleepTime = 100 * time.Millisecond\n\nfunc main() {\n    size := 6\n    myBuffer := rvb.NewBuffer[ThingToStore](size)\n\n    go func() {\n        var i int\n        for {\n            time.Sleep(SleepTime)\n            myBuffer.Push(ThingToStore{ID: i, Text: \"Hello World!\"})\n            i++\n        }\n    }()\n\n    // minimize time-sensitivity\n    time.Sleep(SleepTime / 2)\n\n    // giving time for 3 insertions\n    time.Sleep(SleepTime * 3)\n\n    fmt.Println(\"ReadNew():\")\n    output := myBuffer.ReadNew(size)\n    for _, thing := range output {\n        fmt.Printf(\"%d: %s\\n\", thing.ID, thing.Text)\n    }\n    fmt.Println()\n\n    // giving time for 3 additional insertions, buffer will be entirely populated\n    time.Sleep(SleepTime * 3)\n\n    fmt.Println(\"ReadNew():\")\n    output = myBuffer.ReadNew(size)\n    for _, thing := range output {\n        fmt.Printf(\"%d: %s\\n\", thing.ID, thing.Text)\n    }\n    fmt.Println()\n    \n    // giving time for 3 additional insertions, buffer will be partially overwritten\n    time.Sleep(SleepTime * 3)\n\n    fmt.Println(\"ReadNew():\")\n    output = myBuffer.ReadNew(size)\n    for _, thing := range output {\n        fmt.Printf(\"%d: %s\\n\", thing.ID, thing.Text)\n    }\n}\n```\n\n###### output\n\n```terminaloutput\nReadNew():\n2: Hello World!\n1: Hello World!\n0: Hello World!\n\nReadNew():\n5: Hello World!\n4: Hello World!\n3: Hello World!\n2: Hello World!\n1: Hello World!\n0: Hello World!\n\nReadNew():\n8: Hello World!\n7: Hello World!\n6: Hello World!\n5: Hello World!\n4: Hello World!\n3: Hello World!\n```\n\n##### utilizing checkpoint\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"time\"\n\n    \"github.com/gethiox/rotational-velocidensity-buffer\"\n)\n\ntype ThingToStore struct {\n    ID   int\n    Text string\n}\n\nconst SleepTime = 100 * time.Millisecond\n\nfunc main() {\n    size := 6\n    myBuffer := rvb.NewBuffer[ThingToStore](size)\n\n    go func() {\n        var i int\n        for {\n            time.Sleep(SleepTime)\n            myBuffer.Push(ThingToStore{ID: i, Text: \"Hello World!\"})\n            i++\n        }\n    }()\n\n    // minimize time-sensitivity\n    time.Sleep(SleepTime / 2)\n\n    // giving time for 3 insertions\n    time.Sleep(SleepTime * 3)\n\n    // saving current buffer position\n    checkpoint := myBuffer.GetCheckpoint()\n\n    // giving time for 3 additional insertions, buffer will be entirely populated\n    time.Sleep(SleepTime * 3)\n\n    fmt.Println(\"current view from checkpoint:\")\n    output, missing := myBuffer.ReadNewFromCheckpoint(checkpoint, 0, size)\n    for _, thing := range output {\n        fmt.Printf(\"%d: %s\\n\", thing.ID, thing.Text)\n    }\n    fmt.Printf(\"missing: %#v\\n\", missing)\n    fmt.Println()\n\n    // giving time for 2 additional insertions, buffer will be partially overwritten\n    time.Sleep(SleepTime * 2)\n\n    fmt.Println(\"current view from checkpoint:\")\n    output, missing = myBuffer.ReadNewFromCheckpoint(checkpoint, 0, size)\n    for _, thing := range output {\n        fmt.Printf(\"%d: %s\\n\", thing.ID, thing.Text)\n    }\n    fmt.Printf(\"missing: %#v\\n\", missing)\n}\n```\n\n###### output\n\n```terminaloutput\ncurrent view from checkpoint:\n2: Hello World!\n1: Hello World!\n0: Hello World!\nmissing: rvb.Missing{Reused:0, Max:3}\n\ncurrent view from checkpoint:\n2: Hello World!\nmissing: rvb.Missing{Reused:2, Max:3}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgethiox%2Frotational-velocidensity-buffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgethiox%2Frotational-velocidensity-buffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgethiox%2Frotational-velocidensity-buffer/lists"}