Skip to content

Commit

Permalink
Merged github's README and .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
antage committed Apr 27, 2012
2 parents 345068a + cdef982 commit 0803c63
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
# Ignore Sublime Text 2 files
/*.sublime-*

# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so

# Folders
_obj
_test

# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out

*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*

_testmain.go

*.exe
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# eventsource

Server-sent events for Go.

Package eventsource provides server-sent events for net/http server.

## Usage

``` go
package main

import (
"eventsource"
"log"
"net/http"
"strconv"
"time"
)

func main() {
es := eventsource.New()
defer es.Close()
http.Handle("/events", es)
go func() {
id := 1
for {
es.SendMessage("tick", "tick-event", strconv.Itoa(id))
id++
time.Sleep(2 * time.Second)
}
}()
log.Fatal(http.ListenAndServe(":8080", nil))
}
```

0 comments on commit 0803c63

Please sign in to comment.