Skip to content

Commit

Permalink
Extract SSE to separate module
Browse files Browse the repository at this point in the history
  • Loading branch information
dim13 committed Dec 10, 2020
1 parent 1cddb6d commit 27ade7d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 66 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/dim13/otpauth
go 1.15

require (
github.com/dim13/sse v0.0.0-20201210183205-eb3832327322
github.com/golang/protobuf v1.4.3
github.com/google/uuid v1.1.2
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/dim13/sse v0.0.0-20201210183205-eb3832327322 h1:4+OqyQ9YCRC0WrQKfJHR0Dvqk7tQdML7h2T4e4RjN7o=
github.com/dim13/sse v0.0.0-20201210183205-eb3832327322/go.mod h1:N3FRoDR3nzgckc5E5A5XPpmIlGvEdOBRMlhh5hXLvqk=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
Expand Down
4 changes: 2 additions & 2 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"

"github.com/dim13/otpauth/migration"
"github.com/dim13/otpauth/sse"
"github.com/dim13/sse"
"github.com/google/uuid"
)

Expand Down Expand Up @@ -83,7 +83,7 @@ func serve(addr string, p *migration.Payload) error {
for _, op := range p.OtpParameters {
http.Handle("/"+op.UUID().String()+".png", op)
}
events := sse.NewBroker("data", 100)
events := sse.New("data", 100)
http.Handle("/events", events)
go func() {
enc := json.NewEncoder(events)
Expand Down
64 changes: 0 additions & 64 deletions sse/sse.go

This file was deleted.

0 comments on commit 27ade7d

Please sign in to comment.