Documentation ¶
Index ¶
- Constants
- func CreateConnection(_ api.StreamContext) modules.Connection
- func CreateWebsocketConnection(ctx api.StreamContext) modules.Connection
- func InitGlobalServerManager(ip string, port int, tlsConf *conf.TlsConf)
- func RegisterEndpoint(endpoint string, method string) (string, error)
- func RegisterWebSocketEndpoint(ctx api.StreamContext, endpoint string) (string, string, error)
- func ShutDown()
- func UnRegisterWebSocketEndpoint(endpoint string)
- func UnregisterEndpoint(endpoint string)
- type GlobalServerManager
- func (m *GlobalServerManager) AddEndpointConnection(endpoint string, c *websocket.Conn, cancel context.CancelFunc) *sync.WaitGroup
- func (m *GlobalServerManager) CloseEndpointConnection(endpoint string, c *websocket.Conn)
- func (m *GlobalServerManager) FetchInstanceID() int
- func (m *GlobalServerManager) RegisterEndpoint(endpoint string, method string) (string, error)
- func (m *GlobalServerManager) RegisterWebSocketEndpoint(ctx api.StreamContext, endpoint string) (string, string, error)
- func (m *GlobalServerManager) Shutdown()
- func (m *GlobalServerManager) UnRegisterWebSocketEndpoint(endpoint string) *websocketEndpointContext
- func (m *GlobalServerManager) UnregisterEndpoint(endpoint string)
- type HttpPushConnection
- func (h *HttpPushConnection) Close(ctx api.StreamContext) error
- func (h *HttpPushConnection) DetachSub(ctx api.StreamContext)
- func (h *HttpPushConnection) Dial(ctx api.StreamContext) error
- func (h *HttpPushConnection) GetId(ctx api.StreamContext) string
- func (h *HttpPushConnection) GetTopic() string
- func (h *HttpPushConnection) Ping(ctx api.StreamContext) error
- func (h *HttpPushConnection) Provision(ctx api.StreamContext, conId string, props map[string]any) error
- type WebsocketClient
- type WebsocketConnection
- func (w *WebsocketConnection) Close(ctx api.StreamContext) error
- func (w *WebsocketConnection) Dial(ctx api.StreamContext) error
- func (w *WebsocketConnection) GetId(ctx api.StreamContext) string
- func (w *WebsocketConnection) Ping(ctx api.StreamContext) error
- func (w *WebsocketConnection) Provision(ctx api.StreamContext, conId string, props map[string]any) error
Constants ¶
View Source
const (
TopicPrefix = "$$httppush/"
)
View Source
const (
WebsocketTopicPrefix = "$$websocket/"
)
Variables ¶
This section is empty.
Functions ¶
func CreateConnection ¶
func CreateConnection(_ api.StreamContext) modules.Connection
func CreateWebsocketConnection ¶
func CreateWebsocketConnection(ctx api.StreamContext) modules.Connection
func InitGlobalServerManager ¶
func UnRegisterWebSocketEndpoint ¶
func UnRegisterWebSocketEndpoint(endpoint string)
func UnregisterEndpoint ¶
func UnregisterEndpoint(endpoint string)
Types ¶
type GlobalServerManager ¶
func (*GlobalServerManager) AddEndpointConnection ¶
func (m *GlobalServerManager) AddEndpointConnection(endpoint string, c *websocket.Conn, cancel context.CancelFunc) *sync.WaitGroup
func (*GlobalServerManager) CloseEndpointConnection ¶
func (m *GlobalServerManager) CloseEndpointConnection(endpoint string, c *websocket.Conn)
func (*GlobalServerManager) FetchInstanceID ¶
func (m *GlobalServerManager) FetchInstanceID() int
func (*GlobalServerManager) RegisterEndpoint ¶
func (m *GlobalServerManager) RegisterEndpoint(endpoint string, method string) (string, error)
func (*GlobalServerManager) RegisterWebSocketEndpoint ¶
func (m *GlobalServerManager) RegisterWebSocketEndpoint(ctx api.StreamContext, endpoint string) (string, string, error)
func (*GlobalServerManager) Shutdown ¶
func (m *GlobalServerManager) Shutdown()
func (*GlobalServerManager) UnRegisterWebSocketEndpoint ¶
func (m *GlobalServerManager) UnRegisterWebSocketEndpoint(endpoint string) *websocketEndpointContext
func (*GlobalServerManager) UnregisterEndpoint ¶
func (m *GlobalServerManager) UnregisterEndpoint(endpoint string)
type HttpPushConnection ¶
type HttpPushConnection struct {
// contains filtered or unexported fields
}
func (*HttpPushConnection) Close ¶
func (h *HttpPushConnection) Close(ctx api.StreamContext) error
func (*HttpPushConnection) DetachSub ¶
func (h *HttpPushConnection) DetachSub(ctx api.StreamContext)
func (*HttpPushConnection) Dial ¶
func (h *HttpPushConnection) Dial(ctx api.StreamContext) error
func (*HttpPushConnection) GetId ¶
func (h *HttpPushConnection) GetId(ctx api.StreamContext) string
func (*HttpPushConnection) GetTopic ¶
func (h *HttpPushConnection) GetTopic() string
func (*HttpPushConnection) Ping ¶
func (h *HttpPushConnection) Ping(ctx api.StreamContext) error
func (*HttpPushConnection) Provision ¶
func (h *HttpPushConnection) Provision(ctx api.StreamContext, conId string, props map[string]any) error
type WebsocketClient ¶
type WebsocketClient struct { RecvTopic string SendTopic string // contains filtered or unexported fields }
func NewWebsocketClient ¶
func NewWebsocketClient(addr, path string, tlsConfig *tls.Config) *WebsocketClient
func (*WebsocketClient) Close ¶
func (c *WebsocketClient) Close(ctx api.StreamContext) error
func (*WebsocketClient) Connect ¶
func (c *WebsocketClient) Connect() error
func (*WebsocketClient) Run ¶
func (c *WebsocketClient) Run(ctx api.StreamContext) (string, string)
type WebsocketConnection ¶
type WebsocketConnection struct { RecvTopic string SendTopic string // contains filtered or unexported fields }
func (*WebsocketConnection) Close ¶
func (w *WebsocketConnection) Close(ctx api.StreamContext) error
func (*WebsocketConnection) Dial ¶
func (w *WebsocketConnection) Dial(ctx api.StreamContext) error
func (*WebsocketConnection) GetId ¶
func (w *WebsocketConnection) GetId(ctx api.StreamContext) string
func (*WebsocketConnection) Ping ¶
func (w *WebsocketConnection) Ping(ctx api.StreamContext) error
func (*WebsocketConnection) Provision ¶
func (w *WebsocketConnection) Provision(ctx api.StreamContext, conId string, props map[string]any) error
Click to show internal directories.
Click to hide internal directories.