Documentation
¶
Index ¶
- Variables
- type BroadcastOpt
- type Cache
- type Conn
- type EncodeFn
- type GetFn
- type Pool
- type Stream
- func (sm *Stream) Broadcast(path string, opt BroadcastOpt)
- func (sm *Stream) BroadcastClock(data string)
- func (sm *Stream) Close(key string, client *Conn)
- func (sm *Stream) GetCacheVersion(key string) (int64, error)
- func (sm *Stream) InitClock()
- func (sm *Stream) New(key string, w http.ResponseWriter, r *http.Request) (*Conn, error)
- func (sm *Stream) Patch(poolIndex int, data []byte) ([]byte, bool, int64)
- func (sm *Stream) Read(key string, client *Conn)
- func (sm *Stream) Refresh(path string, getDataFn GetFn) Cache
- func (sm *Stream) Write(client *Conn, data string, snapshot bool, version int64)
- func (sm *Stream) WriteClock(client *Conn, data string)
- type Subscribe
- type Unsubscribe
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BroadcastOpt ¶
type BroadcastOpt struct { Get GetFn Callback func() }
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn extends the websocket connection with a mutex https://godoc.org/github.com/gorilla/websocket#hdr-Concurrency
type Pool ¶
type Pool struct { Key string // contains filtered or unexported fields }
Pool of key filtered connections
type Stream ¶
type Stream struct { OnSubscribe Subscribe OnUnsubscribe Unsubscribe ForcePatch bool NoPatch bool Console *coat.Console // contains filtered or unexported fields }
Stream a group of pools
func (*Stream) Broadcast ¶
func (sm *Stream) Broadcast(path string, opt BroadcastOpt)
Broadcast will look for pools that match a path and broadcast updates
func (*Stream) BroadcastClock ¶
BroadcastClock sends time to all the subscribers
func (*Stream) GetCacheVersion ¶
GetCache by key
func (*Stream) Patch ¶
Patch will return either the snapshot or the patch
patch, false (patch)
snapshot, true (snapshot)
func (*Stream) WriteClock ¶
WriteClock sends time to a subscriber
type Unsubscribe ¶
type Unsubscribe func(key string)
Unsubscribe : function callback on subscription closing
Click to show internal directories.
Click to hide internal directories.