Documentation ¶
Index ¶
- type Broker
- func (b *Broker) Broadcast(event Event)
- func (b *Broker) Close() error
- func (b *Broker) Connect(clientId string, w http.ResponseWriter, r *http.Request) (*ClientConnection, error)
- func (b *Broker) ConnectWithHeartBeatInterval(clientId string, w http.ResponseWriter, r *http.Request, ...) (*ClientConnection, error)
- func (b *Broker) GetClientMetadata(clientId string) (map[string]interface{}, error)
- func (b *Broker) IsClientPresent(clientId string) bool
- func (b *Broker) Send(clientId string, event Event) error
- func (b *Broker) SetClientMetadata(clientId string, metadata map[string]interface{}) error
- func (b *Broker) SetDisconnectCallback(cb func(clientId string, sessionId string))
- type ClientConnection
- type ClientMetadata
- type Event
- type HeartbeatEvent
- type JsonEvent
- type SSEError
- type SSEFeed
- type StreamingUnsupportedError
- type StringEvent
- type Subscription
- type UnknownClientError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
func (*Broker) Connect ¶
func (b *Broker) Connect(clientId string, w http.ResponseWriter, r *http.Request) (*ClientConnection, error)
func (*Broker) ConnectWithHeartBeatInterval ¶ added in v1.0.3
func (b *Broker) ConnectWithHeartBeatInterval(clientId string, w http.ResponseWriter, r *http.Request, interval time.Duration) (*ClientConnection, error)
func (*Broker) GetClientMetadata ¶ added in v1.0.4
func (*Broker) IsClientPresent ¶
func (*Broker) SetClientMetadata ¶ added in v1.0.4
func (*Broker) SetDisconnectCallback ¶
type ClientConnection ¶
type ClientConnection struct {
// contains filtered or unexported fields
}
func (*ClientConnection) Done ¶
func (c *ClientConnection) Done() <-chan interface{}
func (*ClientConnection) Id ¶
func (c *ClientConnection) Id() string
func (*ClientConnection) Send ¶
func (c *ClientConnection) Send(event Event)
func (*ClientConnection) SessionId ¶
func (c *ClientConnection) SessionId() string
type ClientMetadata ¶ added in v1.0.4
type ClientMetadata map[string]interface{}
type HeartbeatEvent ¶
type HeartbeatEvent struct{}
func (HeartbeatEvent) GetData ¶
func (h HeartbeatEvent) GetData() string
func (HeartbeatEvent) GetEvent ¶
func (h HeartbeatEvent) GetEvent() string
func (HeartbeatEvent) GetId ¶
func (h HeartbeatEvent) GetId() string
func (HeartbeatEvent) Prepare ¶
func (h HeartbeatEvent) Prepare() []byte
type SSEFeed ¶
type SSEFeed struct {
// contains filtered or unexported fields
}
func ConnectWithSSEFeed ¶
type StreamingUnsupportedError ¶ added in v1.0.3
type StreamingUnsupportedError struct {
SSEError
}
func NewStreamingUnsupportedError ¶ added in v1.0.3
func NewStreamingUnsupportedError(msg string) *StreamingUnsupportedError
func (StreamingUnsupportedError) Error ¶ added in v1.0.3
func (s StreamingUnsupportedError) Error() string
type StringEvent ¶
func (StringEvent) GetData ¶
func (e StringEvent) GetData() string
func (StringEvent) GetEvent ¶
func (e StringEvent) GetEvent() string
func (StringEvent) GetId ¶
func (e StringEvent) GetId() string
func (StringEvent) Prepare ¶
func (e StringEvent) Prepare() []byte
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
func (*Subscription) Close ¶
func (s *Subscription) Close()
func (*Subscription) ErrFeed ¶
func (s *Subscription) ErrFeed() <-chan error
func (*Subscription) EventType ¶
func (s *Subscription) EventType() string
func (*Subscription) Feed ¶
func (s *Subscription) Feed() <-chan Event
type UnknownClientError ¶ added in v1.0.3
type UnknownClientError struct {
SSEError
}
func NewUnknownClientError ¶ added in v1.0.3
func NewUnknownClientError(clientId string) *UnknownClientError
func (UnknownClientError) Error ¶ added in v1.0.3
func (u UnknownClientError) Error() string
Click to show internal directories.
Click to hide internal directories.