From ee99ef1a410fe7eb51b6d9eec4c68807f0e4df33 Mon Sep 17 00:00:00 2001 From: t-u-r-b-o-3-0-0-0 Date: Tue, 18 Apr 2023 15:21:01 +0200 Subject: [PATCH] updated references; --- .gitignore | 1 + README.md | 13 ++++++++----- _examples/README.md | 12 ++++++------ _examples/chi.go | 2 +- _examples/echo.go | 3 +-- _examples/gin.go | 2 +- _examples/gorilla.go | 2 +- _examples/iris/go.mod | 2 +- _examples/iris/main.go | 3 --- _examples/net_http.go | 2 +- _examples/net_http_options.go | 2 +- docker-compose.yml | 4 ++-- go.mod | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index daf913b..9ba2d43 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.idea # Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a diff --git a/README.md b/README.md index e5bf564..0256eae 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,14 @@ # go-sse -[![Go Report Card](https://goreportcard.com/badge/github.com/alexandrevicenzi/go-sse)](https://goreportcard.com/report/github.com/alexandrevicenzi/go-sse) +[![Go Report Card](https://goreportcard.com/badge/github.com/nfwsncked/go-sse)](https://goreportcard.com/report/github.com/nfwsncked/go-sse) [![Build Status](https://travis-ci.org/alexandrevicenzi/go-sse.svg?branch=master)](https://travis-ci.org/alexandrevicenzi/go-sse) -[![GoDoc](https://godoc.org/github.com/alexandrevicenzi/go-sse?status.svg)](http://godoc.org/github.com/alexandrevicenzi/go-sse) +[![GoDoc](https://godoc.org/github.com/nfwsncked/go-sse?status.svg)](http://godoc.org/github.com/nfwsncked/go-sse) Server-Sent Events for Go +## Fork reasoning +Some event driven patterns require direct access to the client upon connect/disconnect. Original repo doesn't provide any potential access to these and seems to be not that much maintained. I didn't find any reasonably good implementations across other forks, so why not contributing myself or with your help :) + ## About [Server-sent events](http://www.html5rocks.com/en/tutorials/eventsource/basics/) is a method of continuously sending data from a server to the browser, rather than repeatedly requesting it, replacing the "long polling way". @@ -25,7 +28,7 @@ It's [supported](http://caniuse.com/#feat=eventsource) by all major browsers and ## Instalation -`go get github.com/alexandrevicenzi/go-sse` +`go get github.com/nfwsncked/go-sse` ## Example @@ -40,7 +43,7 @@ import ( "strconv" "time" - "github.com/alexandrevicenzi/go-sse" + "github.com/nfwsncked/go-sse" ) func main() { @@ -73,7 +76,7 @@ e.onmessage = function(event) { }; ``` -More examples available [here](https://github.com/alexandrevicenzi/go-sse/tree/master/_examples). +More examples available [here](https://github.com/nfwsncked/go-sse/tree/master/_examples). ## License diff --git a/_examples/README.md b/_examples/README.md index 82d2dee..d6eb3d9 100644 --- a/_examples/README.md +++ b/_examples/README.md @@ -4,10 +4,10 @@ Examples on how to use `go-sse` with multiple libraries and frameworks. | Project | Supported | Example | |:--------|:---------:|:-------:| -| [chi](https://github.com/go-chi/chi) | ✔ | [chi.go](https://github.com/alexandrevicenzi/go-sse/blob/master/_examples/chi.go) | -| [echo](https://github.com/labstack/echo) | ✔ | [echo.go](https://github.com/alexandrevicenzi/go-sse/blob/master/_examples/echo.go) | +| [chi](https://github.com/go-chi/chi) | ✔ | [chi.go](https://github.com/nfwsncked/go-sse/blob/master/_examples/chi.go) | +| [echo](https://github.com/labstack/echo) | ✔ | [echo.go](https://github.com/nfwsncked/go-sse/blob/master/_examples/echo.go) | | [fasthttp](https://github.com/valyala/fasthttp) | ✘ | | -| [gin](https://github.com/gin-gonic/gin) | ✔ | [gin.go](https://github.com/alexandrevicenzi/go-sse/blob/master/_examples/gin.go) | -| [iris](https://github.com/kataras/iris) | ✔ | [iris/main.go](https://github.com/alexandrevicenzi/go-sse/blob/master/_examples/iris/main.go) | -| [gorilla/mux](https://github.com/gorilla/mux) | ✔ | [gorilla.go](https://github.com/alexandrevicenzi/go-sse/blob/master/_examples/gorilla.go) | -| `net/http` | ✔ | [net_http.go](https://github.com/alexandrevicenzi/go-sse/blob/master/_examples/net_http.go) or [net_http_options.go](https://github.com/alexandrevicenzi/go-sse/blob/master/_examples/net_http_options.go) | +| [gin](https://github.com/gin-gonic/gin) | ✔ | [gin.go](https://github.com/nfwsncked/go-sse/blob/master/_examples/gin.go) | +| [iris](https://github.com/kataras/iris) | ✔ | [iris/main.go](https://github.com/nfwsncked/go-sse/blob/master/_examples/iris/main.go) | +| [gorilla/mux](https://github.com/gorilla/mux) | ✔ | [gorilla.go](https://github.com/nfwsncked/go-sse/blob/master/_examples/gorilla.go) | +| `net/http` | ✔ | [net_http.go](https://github.com/nfwsncked/go-sse/blob/master/_examples/net_http.go) or [net_http_options.go](https://github.com/nfwsncked/go-sse/blob/master/_examples/net_http_options.go) | diff --git a/_examples/chi.go b/_examples/chi.go index f1f2a30..78b83b6 100644 --- a/_examples/chi.go +++ b/_examples/chi.go @@ -6,9 +6,9 @@ import ( "strconv" "time" - "github.com/alexandrevicenzi/go-sse" "github.com/go-chi/chi" "github.com/go-chi/chi/middleware" + "github.com/nfwsncked/go-sse" ) func main() { diff --git a/_examples/echo.go b/_examples/echo.go index 17abdd2..ee1ce23 100644 --- a/_examples/echo.go +++ b/_examples/echo.go @@ -4,8 +4,7 @@ import ( "strconv" "time" - "github.com/alexandrevicenzi/go-sse" - "github.com/labstack/echo/v4" + "github.com/nfwsncked/go-sse" ) func main() { diff --git a/_examples/gin.go b/_examples/gin.go index 493fff3..2e8319c 100644 --- a/_examples/gin.go +++ b/_examples/gin.go @@ -5,8 +5,8 @@ import ( "strconv" "time" - "github.com/alexandrevicenzi/go-sse" "github.com/gin-gonic/gin" + "github.com/nfwsncked/go-sse" ) func main() { diff --git a/_examples/gorilla.go b/_examples/gorilla.go index 5600a78..d5378af 100644 --- a/_examples/gorilla.go +++ b/_examples/gorilla.go @@ -6,8 +6,8 @@ import ( "strconv" "time" - "github.com/alexandrevicenzi/go-sse" "github.com/gorilla/mux" + "github.com/nfwsncked/go-sse" ) func main() { diff --git a/_examples/iris/go.mod b/_examples/iris/go.mod index 68cfaf6..ef1db3e 100644 --- a/_examples/iris/go.mod +++ b/_examples/iris/go.mod @@ -3,6 +3,6 @@ module iris_example go 1.15 require ( - github.com/alexandrevicenzi/go-sse v1.6.0 + github.com/nfwsncked/go-sse v1.6.0 github.com/kataras/iris/v12 v12.2.0-alpha2.0.20210127020946-ce25e698f8f8 ) diff --git a/_examples/iris/main.go b/_examples/iris/main.go index 85a4426..b196b51 100644 --- a/_examples/iris/main.go +++ b/_examples/iris/main.go @@ -6,9 +6,6 @@ import ( "os" "strconv" "time" - - "github.com/alexandrevicenzi/go-sse" - "github.com/kataras/iris/v12" ) func main() { diff --git a/_examples/net_http.go b/_examples/net_http.go index 11134c0..61c9b18 100644 --- a/_examples/net_http.go +++ b/_examples/net_http.go @@ -6,7 +6,7 @@ import ( "strconv" "time" - "github.com/alexandrevicenzi/go-sse" + "github.com/nfwsncked/go-sse" ) func main() { diff --git a/_examples/net_http_options.go b/_examples/net_http_options.go index 8c9640d..0a8936d 100644 --- a/_examples/net_http_options.go +++ b/_examples/net_http_options.go @@ -7,7 +7,7 @@ import ( "strconv" "time" - "github.com/alexandrevicenzi/go-sse" + "github.com/nfwsncked/go-sse" ) func main() { diff --git a/docker-compose.yml b/docker-compose.yml index b639427..cd9c9b6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,10 @@ sse: image: golang:alpine - working_dir: /go/src/github.com/alexandrevicenzi/go-sse + working_dir: /go/src/github.com/nfwsncked/go-sse command: bash -c "cd _examples && go run net_http.go" ports: - "3000:3000" environment: - GO111MODULE=on volumes: - - .:/go/src/github.com/alexandrevicenzi/go-sse + - .:/go/src/github.com/nfwsncked/go-sse diff --git a/go.mod b/go.mod index 55d2b76..da9abbb 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/alexandrevicenzi/go-sse +module github.com/nfwsncked/go-sse -go 1.11 +go 1.20