{"id":24956846,"url":"https://github.com/andrewstuart/go-sse","last_synced_at":"2025-08-16T23:11:15.979Z","repository":{"id":46820146,"uuid":"41777522","full_name":"andrewstuart/go-sse","owner":"andrewstuart","description":"A golang sse client.","archived":false,"fork":false,"pushed_at":"2021-09-23T15:39:23.000Z","size":13,"stargazers_count":14,"open_issues_count":0,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-13T16:16:12.539Z","etag":null,"topics":["golang","server-sent-events","sse"],"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/andrewstuart.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}},"created_at":"2015-09-02T03:26:23.000Z","updated_at":"2024-07-17T14:14:27.000Z","dependencies_parsed_at":"2022-09-06T19:42:28.906Z","dependency_job_id":null,"html_url":"https://github.com/andrewstuart/go-sse","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/andrewstuart/go-sse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewstuart%2Fgo-sse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewstuart%2Fgo-sse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewstuart%2Fgo-sse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewstuart%2Fgo-sse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewstuart","download_url":"https://codeload.github.com/andrewstuart/go-sse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewstuart%2Fgo-sse/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270364051,"owners_count":24571400,"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","status":"online","status_checked_at":"2025-08-14T02:00:10.309Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["golang","server-sent-events","sse"],"created_at":"2025-02-03T06:41:23.313Z","updated_at":"2025-08-16T23:11:15.962Z","avatar_url":"https://github.com/andrewstuart.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](https://godoc.org/astuart.co/go-sse?status.svg)](https://godoc.org/astuart.co/go-sse)\n\n# sse\n--\n    import \"astuart.co/go-sse\"\n\n\n## Usage\n\n```go\nvar Client = \u0026http.Client{}\n```\nClient is the default client used for requests.\n\n```go\nvar (\n\t//ErrNilChan will be returned by Notify if it is passed a nil channel\n\tErrNilChan = fmt.Errorf(\"nil channel given\")\n)\n```\n\n```go\nvar GetReq = func(verb, uri string, body io.Reader) (*http.Request, error) {\n\treturn http.NewRequest(verb, uri, body)\n}\n```\nGetReq is a function to return a single request. It will be used by notify to\nget a request and can be replaces if additional configuration is desired on the\nrequest. The \"Accept\" header will necessarily be overwritten.\n\n#### func  Notify\n\n```go\nfunc Notify(uri string, evCh chan\u003c- *Event) error\n```\nNotify takes the uri of an SSE stream and channel, and will send an Event down\nthe channel when recieved, until the stream is closed. It will then close the\nstream. This is blocking, and so you will likely want to call this in a new\ngoroutine (via `go Notify(..)`)\n\n#### type Event\n\n```go\ntype Event struct {\n\tURI  string\n\tType string\n\tData io.Reader\n}\n```\n\nEvent is a go representation of an http server-sent event\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewstuart%2Fgo-sse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewstuart%2Fgo-sse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewstuart%2Fgo-sse/lists"}