httpserver

package
v2.0.0-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

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 InitGlobalServerManager(ip string, port int, tlsConf *conf.TlsConf)

func RegisterEndpoint

func RegisterEndpoint(endpoint string, method string) (string, error)

func RegisterWebSocketEndpoint

func RegisterWebSocketEndpoint(ctx api.StreamContext, endpoint string) (string, string, error)

func ShutDown

func ShutDown()

func UnRegisterWebSocketEndpoint

func UnRegisterWebSocketEndpoint(endpoint string)

func UnregisterEndpoint

func UnregisterEndpoint(endpoint string)

Types

type GlobalServerManager

type GlobalServerManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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 (*HttpPushConnection) GetId

func (*HttpPushConnection) GetTopic

func (h *HttpPushConnection) GetTopic() string

func (*HttpPushConnection) Ping

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

type WebsocketConnection

type WebsocketConnection struct {
	RecvTopic string
	SendTopic string
	// contains filtered or unexported fields
}

func (*WebsocketConnection) Close

func (*WebsocketConnection) Dial

func (*WebsocketConnection) GetId

func (*WebsocketConnection) Ping

func (*WebsocketConnection) Provision

func (w *WebsocketConnection) Provision(ctx api.StreamContext, conId string, props map[string]any) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL