{"id":13694494,"url":"https://github.com/itsubaki/gostream","last_synced_at":"2025-10-20T10:27:25.096Z","repository":{"id":41203312,"uuid":"96116041","full_name":"itsubaki/gostream","owner":"itsubaki","description":"Stream Processing library for Go","archived":false,"fork":false,"pushed_at":"2023-09-30T14:08:43.000Z","size":240,"stargazers_count":56,"open_issues_count":0,"forks_count":8,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-31T20:39:53.692Z","etag":null,"topics":["complex-event-processing","stream-processing"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/itsubaki/gostream","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/itsubaki.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}},"created_at":"2017-07-03T13:51:59.000Z","updated_at":"2024-11-21T04:06:01.000Z","dependencies_parsed_at":"2022-07-14T10:31:22.386Z","dependency_job_id":"b1182d82-f1f7-4ded-8e83-1131231d5057","html_url":"https://github.com/itsubaki/gostream","commit_stats":null,"previous_names":["itsubaki/gostream-core"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsubaki%2Fgostream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsubaki%2Fgostream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsubaki%2Fgostream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsubaki%2Fgostream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsubaki","download_url":"https://codeload.github.com/itsubaki/gostream/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253174418,"owners_count":21865863,"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":["complex-event-processing","stream-processing"],"created_at":"2024-08-02T17:01:33.575Z","updated_at":"2025-10-20T10:27:25.091Z","avatar_url":"https://github.com/itsubaki.png","language":"Go","funding_links":[],"categories":["开源类库","Open source library"],"sub_categories":["流处理","Stream Processing"],"readme":"# gostream\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/itsubaki/gostream)](https://pkg.go.dev/github.com/itsubaki/gostream)\n[![Go Report Card](https://goreportcard.com/badge/github.com/itsubaki/gostream?style=flat-square)](https://goreportcard.com/report/github.com/itsubaki/gostream)\n[![tests](https://github.com/itsubaki/gostream/workflows/tests/badge.svg?branch=main)](https://github.com/itsubaki/gostream/actions)\n\n- Stream processing library for Go\n\n## TODO\n\n- [x] Window\n  - [x] LengthWindow\n  - [x] LengthBatchWindow\n  - [x] TimeWindow\n  - [x] TimeBatchWindow\n- [x] Select\n- [ ] Where\n  - [x] Equals, NotEquals\n  - [x] Larger, Less\n  - [ ] AND, OR\n- [x] OrderBy\n- [x] Limit, Offset\n- [x] Aggregate Function\n  - [x] Avg, Sum, Count\n  - [x] Max, Min\n\n## Example\n\n```go\ntype LogEvent struct {\n  Time    time.Time\n  Level   int\n  Message string\n}\n\nq := \"select * from LogEvent.length(10)\"\ns, err := gostream.New().\n    Add(LogEvent{}).\n    Query(q)\nif err != nil {\n  fmt.Printf(\"new gostream: %v\", err)\n  return\n}\ndefer s.Close()\n\ngo func() {\n  for {\n    fmt.Printf(\"%v\\n\", \u003c-s.Output())\n  }\n}()\n\ns.Input() \u003c- LogEvent{\n  Time: time.Now()\n  Level: 1\n  Message: \"something happened\"\n}\n```\n\n```go\ntype LogEvent struct {\n  Time    time.Time\n  Level   int\n  Message string\n}\n\ns := stream.New().\n  SelectAll().\n  From(LogEvent{}).\n  Length(10).\n  OrderBy(\"Level\", stream.DESC).\n  Limit(10, 5)\ndefer s.Close()\ngo s.Run()\n\ngo func() {\n  for {\n    fmt.Printf(\"%v\\n\", \u003c-s.Output())\n  }\n}()\n\ns.Input() \u003c- LogEvent{\n  Time: time.Now()\n  Level: 1\n  Message: \"something happened\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsubaki%2Fgostream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsubaki%2Fgostream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsubaki%2Fgostream/lists"}