{"id":26448583,"url":"https://github.com/scorum/event-provider-go","last_synced_at":"2025-03-18T14:35:06.452Z","repository":{"id":33415772,"uuid":"138724533","full_name":"scorum/event-provider-go","owner":"scorum","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-14T08:24:15.000Z","size":4772,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-06-19T19:42:18.119Z","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/scorum.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}},"created_at":"2018-06-26T10:49:36.000Z","updated_at":"2022-01-06T20:39:31.000Z","dependencies_parsed_at":"2024-03-14T09:36:45.176Z","dependency_job_id":"48ae93a6-1961-480e-81f3-276c442d1239","html_url":"https://github.com/scorum/event-provider-go","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scorum%2Fevent-provider-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scorum%2Fevent-provider-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scorum%2Fevent-provider-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scorum%2Fevent-provider-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scorum","download_url":"https://codeload.github.com/scorum/event-provider-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244240945,"owners_count":20421555,"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":"2025-03-18T14:35:05.942Z","updated_at":"2025-03-18T14:35:06.443Z","avatar_url":"https://github.com/scorum.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scorum/event-provider-go\n[![Go Report Card](https://goreportcard.com/badge/github.com/scorum/event-provider-go)](https://goreportcard.com/report/github.com/scorum/event-provider-go)\n[![GoDoc](https://godoc.org/github.com/scorum/event-provider-go?status.svg)](https://godoc.org/github.com/scorum/event-provider-go)\n[![Build Status](https://travis-ci.org/scorum/event-provider-go.svg?branch=master)](https://travis-ci.org/scorum/event-provider-go.svg?branch=master)\n\nGolang wrapper under [scorum-go](https://github.com/scorum/scorum-go).  \n\n## Usage\n\n```go\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\n\t\"github.com/scorum/event-provider-go/event\"\n\t\"github.com/scorum/event-provider-go/provider\"\n\tlog \"github.com/sirupsen/logrus\"\n)\n\nfunc main() {\n\tprovider := provider.NewProvider(\"https://testnet.scorum.com\", provider.SyncInterval(time.Second))\n\n\tctx, cancel := context.WithCancel(context.Background())\n\n\tblocksCh, irreversibleBlocksCh, errorCh := provider.Provide(ctx, 2220447, 2220447,\n\t\t[]event.Type{event.CommentEventType, event.PostEventType, event.VoteEventType, event.FlagEventType})\n\n\tsigCh := make(chan os.Signal, 1)\n\tsignal.Notify(sigCh,\n\t\tsyscall.SIGHUP,\n\t\tsyscall.SIGINT,\n\t\tsyscall.SIGTERM,\n\t\tsyscall.SIGQUIT)\n\tgo func() {\n\t\t\u003c-sigCh\n\t\tcancel()\n\t}()\n\n\tfor {\n\t\tselect {\n\t\tcase e := \u003c-errorCh:\n\t\t\tpanic(e)\n\t\tcase \u003c-ctx.Done():\n\t\t\treturn\n\t\tcase b := \u003c-blocksCh:\n\t\t\tlog.Infof(\"reversible block %d with %d operations\", b.BlockNum, len(b.Events))\n\t\tcase b := \u003c-irreversibleBlocksCh:\n\t\t\tlog.Infof(\"irreversible block %d with %d operations\", b.BlockNum, len(b.Events))\n\t\t}\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscorum%2Fevent-provider-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscorum%2Fevent-provider-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscorum%2Fevent-provider-go/lists"}