From 44e95010056cbbcaa5f82d67c0b04daa3ac0a64a Mon Sep 17 00:00:00 2001 From: Sergey Solodyagin Date: Fri, 25 Oct 2024 16:00:24 +0300 Subject: [PATCH] rename module --- .github/dependabot.yml | 15 ----------- .github/workflows/go.yml | 55 ---------------------------------------- .golangci.yml | 3 --- README.md | 13 +++++----- go.mod | 2 +- 5 files changed, 7 insertions(+), 81 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/go.yml delete mode 100644 .golangci.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 827f529..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,15 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - -version: 2 -updates: - - package-ecosystem: github-actions - directory: / - schedule: - interval: weekly - - package-ecosystem: gomod - directory: / - schedule: - interval: weekly diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index 336a519..0000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Go - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Setup go - uses: actions/setup-go@v3 - with: - go-version: 1.16 - - name: Checkout repository - uses: actions/checkout@v3 - - name: Setup golangci-lint - uses: golangci/golangci-lint-action@v3.2.0 - with: - version: v1.41.1 - args: --verbose - build: - runs-on: ubuntu-latest - env: - GO111MODULE: on - strategy: - matrix: - go-version: [1.13, 1.14, 1.15, 1.16, 1.17] - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3.2.5 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: ${{ matrix.go-version }} - - - name: Build - run: go build -v ./... - - - name: Test - run: go test -race -v -count=1 -coverprofile=coverage.out ./... - - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: go-${{ matrix.go-version }} diff --git a/.golangci.yml b/.golangci.yml deleted file mode 100644 index 4c44c5f..0000000 --- a/.golangci.yml +++ /dev/null @@ -1,3 +0,0 @@ -linters: - disable: - - errcheck diff --git a/README.md b/README.md index cebe482..c57792d 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,16 @@ # Server-Sent Events -[![Go Reference](https://pkg.go.dev/badge/github.com/gin-contrib/sse.svg)](https://pkg.go.dev/github.com/gin-contrib/sse) -[![Build Status](https://github.com/gin-contrib/sse/actions/workflows/go.yml/badge.svg)](https://github.com/gin-contrib/sse/actions/workflows/go.yml) -[![codecov](https://codecov.io/gh/gin-contrib/sse/branch/master/graph/badge.svg)](https://codecov.io/gh/gin-contrib/sse) -[![Go Report Card](https://goreportcard.com/badge/github.com/gin-contrib/sse)](https://goreportcard.com/report/github.com/gin-contrib/sse) - Server-sent events (SSE) is a technology where a browser receives automatic updates from a server via HTTP connection. The Server-Sent Events EventSource API is [standardized as part of HTML5[1] by the W3C](http://www.w3.org/TR/2009/WD-eventsource-20091029/). - [Read this great SSE introduction by the HTML5Rocks guys](http://www.html5rocks.com/en/tutorials/eventsource/basics/) - [Browser support](http://caniuse.com/#feat=eventsource) +Copied from [gin-contrib/sse](https://github.com/gin-contrib/sse) + ## Sample code ```go -import "github.com/gin-contrib/sse" +import "git.company.lan/gopkg/gin-sse" func httpHandler(w http.ResponseWriter, req *http.Request) { // data can be a primitive like a string, an integer or a float @@ -34,6 +31,7 @@ func httpHandler(w http.ResponseWriter, req *http.Request) { }) } ``` + ``` event: message data: some data\\nmore data @@ -41,7 +39,7 @@ data: some data\\nmore data id: 124 event: message data: {"content":"hi!","date":1431540810,"user":"manu"} - + ``` ## Content-Type @@ -49,6 +47,7 @@ data: {"content":"hi!","date":1431540810,"user":"manu"} ```go fmt.Println(sse.ContentType) ``` + ``` text/event-stream ``` diff --git a/go.mod b/go.mod index 7f65e28..e0acf34 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/gin-contrib/sse +module git.company.lan/gopkg/gin-sse go 1.13