Skip to content

Instantly share code, notes, and snippets.

@schmohlio
schmohlio / sse.go
Last active February 13, 2023 08:38 — forked from ismasan/sse.go
Example SSE server in Golang
// v2 of the great example of SSE in go by @ismasan.
// includes fixes:
// * infinite loop ending in panic
// * closing a client twice
// * potentially blocked listen() from closing a connection during multiplex step.
package main
import (
"fmt"
"log"
@focusj
focusj / mongo.go
Created January 21, 2020 07:37
mongo query language golang
package driver
import (
"context"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
)
type Filter struct {
ds map[string]interface{}
@mirzaakhena
mirzaakhena / sse.go
Created July 27, 2020 08:44
Server Sent Events (SSE) Golang Server implementation
package main
import (
"fmt"
"net/http"
"sync"
"github.com/gin-gonic/gin"
)