Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ConnectionIdNotFound = errors.New("oortcloud: connection id not found")
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type ConnectionMap ¶
type ConnectionMap struct {
// contains filtered or unexported fields
}
func NewConnectionMap ¶
func NewConnectionMap() *ConnectionMap
func (*ConnectionMap) Delete ¶
func (c *ConnectionMap) Delete(id string)
func (*ConnectionMap) Get ¶
func (c *ConnectionMap) Get(id string) (Connection, bool)
func (*ConnectionMap) New ¶
func (c *ConnectionMap) New(con Connection) string
type FuncConnection ¶
func (*FuncConnection) Send ¶
func (c *FuncConnection) Send(data []byte) error
type FuncNotifier ¶
type FuncNotifier struct {
ConnectFunc func(con Connection, request *http.Request) (string, *http.Response, error)
DisconnectFunc func(id string) error
NotifyFunc func(id string, data []byte) error
}
func (*FuncNotifier) Connect ¶
func (n *FuncNotifier) Connect(con Connection, request *http.Request) (string, *http.Response, error)
func (*FuncNotifier) Disconnect ¶
func (n *FuncNotifier) Disconnect(id string) error
type HTTPNotifier ¶
type HTTPNotifier struct {
URLs []string
BodyType string
Client *http.Client
// contains filtered or unexported fields
}
func NewHTTPNotifier ¶
func NewHTTPNotifier(urls []string) *HTTPNotifier
func (*HTTPNotifier) Connect ¶
func (n *HTTPNotifier) Connect(con Connection, request *http.Request) (string, *http.Response, error)
func (*HTTPNotifier) Disconnect ¶
func (n *HTTPNotifier) Disconnect(id string) error
func (*HTTPNotifier) ServeHTTP ¶
func (n *HTTPNotifier) ServeHTTP(w http.ResponseWriter, req *http.Request)
type WebSocketConnection ¶
type WebSocketConnection struct {
// contains filtered or unexported fields
}
func (*WebSocketConnection) Send ¶
func (c *WebSocketConnection) Send(data []byte) error
type WebSocketConnector ¶
type WebSocketConnector struct {
// contains filtered or unexported fields
}
func NewWebSocketConnector ¶
func NewWebSocketConnector(notifier Notifier, binary bool) *WebSocketConnector
func (*WebSocketConnector) ServeHTTP ¶
func (c *WebSocketConnector) ServeHTTP(w http.ResponseWriter, req *http.Request)
Handle implements the http.Handler interface
Source Files
¶
Click to show internal directories.
Click to hide internal directories.