func NewServer() *Server {
	srv := &Server{
		registrations: make(chan *registration),
		pub:           make(chan *outbound),
		subs:          make(chan *subscription),
		unregister:    make(chan *subscription, 2),
		quit:          make(chan bool),
		BufferSize:    128,
	}
	go srv.run()
	return srv
}
Create a new Server ready for handler creation and publishing events
package eventsource
import (
	"log"
	"net/http"
	"strings"
)
type subscription struct {
	channel     string
	lastEventId string
	out         chan Event
}
type outbound struct {
	channels []string
	event    Event
}
type registration struct {
	channel    string
	repository Repository
}
type Server struct {
	AllowCORS     bool         
	ReplayAll     bool         
	BufferSize    int          
	Gzip          bool         
	Logger        *log.Logger  
	registrations chan *registration
	pub           chan *outbound
	subs          chan *subscription
	unregister    chan *subscription
	quit          chan bool
}