Documentation ¶
Overview ¶
Implementation of a HTTP Longpoll client and server.
This package is heavily inspired by J Cuga's `golongpoll` package (https://github.com/jcuga/golongpoll). It provides a longpoll client and server and supports both last-value cache (LVC) or a full event history.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoSubscribers = errors.New("no subscribers")
Functions ¶
func MillisecondEpoch ¶
Types ¶
type Event ¶
type Event struct {
Data json.RawMessage `json:"data"`
}
type Manager ¶
func NewManager ¶
func NewManager(opts ...ManagerOption) *Manager
type ManagerOption ¶
type ManagerOption func(*managerOptions)
func LVC ¶
func LVC(l bool) ManagerOption
func MaxTimeout ¶
func MaxTimeout(m int) ManagerOption
type Watcher ¶
func NewWatcher ¶
func NewWatcher(opts ...WatcherOption) *Watcher
type WatcherOption ¶
type WatcherOption func(*watcherOptions)
func Endpoint ¶
func Endpoint(e string) WatcherOption
func Since ¶
func Since(s time.Time) WatcherOption
func Transport ¶
func Transport(t *http.Transport) WatcherOption
Click to show internal directories.
Click to hide internal directories.