Documentation ¶
Index ¶
- type PushServer
- func (ps *PushServer) Channel(srv pushv1.PushService_ChannelServer) error
- func (ps *PushServer) GetClientActiveDevices(ctx context.Context, req *pushv1.GetClientActiveDevicesRequest) (*pushv1.GetClientActiveDevicesResponse, error)
- func (ps *PushServer) HandleReceivedPayload(ctx context.Context, srv pushv1.PushService_ChannelServer, ...)
- func (ps *PushServer) SendEventToClientChannel(ctx context.Context, req *pushv1.SendEventToClientChannelRequest) (*pushv1.SendEventToClientChannelResponse, error)
- func (ps *PushServer) SendEventToClientDeviceChannel(ctx context.Context, req *pushv1.SendEventToClientDeviceChannelRequest) (*pushv1.SendEventToClientDeviceChannelResponse, error)
- func (ps *PushServer) SendEventToTopic(ctx context.Context, req *pushv1.SendEventToTopicRequest) (*pushv1.SendEventToTopicResponse, error)
- func (ps *PushServer) SendEventToTopics(ctx context.Context, req *pushv1.SendEventToTopicsRequest) (*pushv1.SendEventToTopicsResponse, error)
- type WebSocketServerWrapper
- func (ws *WebSocketServerWrapper) Context() context.Context
- func (ws *WebSocketServerWrapper) Recv() (*pushv1.ChannelRequest, error)
- func (ws *WebSocketServerWrapper) RecvMsg(m any) error
- func (ws *WebSocketServerWrapper) Send(resp *pushv1.ChannelResponse) error
- func (ws *WebSocketServerWrapper) SendHeader(md metadata.MD) error
- func (ws *WebSocketServerWrapper) SendMsg(m any) error
- func (ws *WebSocketServerWrapper) SetHeader(md metadata.MD) error
- func (ws *WebSocketServerWrapper) SetTrailer(md metadata.MD)
- func (ws *WebSocketServerWrapper) WebSocketConnect(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PushServer ¶
type PushServer struct { pushv1.UnimplementedPushServiceServer // contains filtered or unexported fields }
PushServer implements push web component
func NewPushServer ¶
func NewPushServer(svc *push.Service, config config.Config) *PushServer
NewPushServer returns the web server for push
func (*PushServer) Channel ¶
func (ps *PushServer) Channel(srv pushv1.PushService_ChannelServer) error
Channel to the push server and receive streaming response
func (*PushServer) GetClientActiveDevices ¶
func (ps *PushServer) GetClientActiveDevices(ctx context.Context, req *pushv1.GetClientActiveDevicesRequest) (*pushv1.GetClientActiveDevicesResponse, error)
GetClientActiveDevices returns currently online devices for a client
func (*PushServer) HandleReceivedPayload ¶
func (ps *PushServer) HandleReceivedPayload(ctx context.Context, srv pushv1.PushService_ChannelServer, receivedRequest *pushv1.ChannelRequest, clientSubscription *subscription.Subscription)
HandleReceivedPayload handles the received requests from the client
func (*PushServer) SendEventToClientChannel ¶
func (ps *PushServer) SendEventToClientChannel(ctx context.Context, req *pushv1.SendEventToClientChannelRequest) (*pushv1.SendEventToClientChannelResponse, error)
SendEventToClientChannel sends event to a client
func (*PushServer) SendEventToClientDeviceChannel ¶
func (ps *PushServer) SendEventToClientDeviceChannel(ctx context.Context, req *pushv1.SendEventToClientDeviceChannelRequest) (*pushv1.SendEventToClientDeviceChannelResponse, error)
SendEventToClientDeviceChannel sends event to a client with device
func (*PushServer) SendEventToTopic ¶
func (ps *PushServer) SendEventToTopic(ctx context.Context, req *pushv1.SendEventToTopicRequest) (*pushv1.SendEventToTopicResponse, error)
SendEventToTopic sends event to a topic
func (*PushServer) SendEventToTopics ¶
func (ps *PushServer) SendEventToTopics(ctx context.Context, req *pushv1.SendEventToTopicsRequest) (*pushv1.SendEventToTopicsResponse, error)
SendEventToTopics sends event to multiple topics
type WebSocketServerWrapper ¶
type WebSocketServerWrapper struct { PushServer *PushServer Ctx context.Context CancelFunc context.CancelFunc // contains filtered or unexported fields }
WebSocketServerWrapper implements pushv1.PushService_ConnectServer for WebSocket
func (*WebSocketServerWrapper) Context ¶
func (ws *WebSocketServerWrapper) Context() context.Context
Context ...
func (*WebSocketServerWrapper) Recv ¶
func (ws *WebSocketServerWrapper) Recv() (*pushv1.ChannelRequest, error)
Recv ...
func (*WebSocketServerWrapper) RecvMsg ¶
func (ws *WebSocketServerWrapper) RecvMsg(m any) error
RecvMsg ...
func (*WebSocketServerWrapper) Send ¶
func (ws *WebSocketServerWrapper) Send(resp *pushv1.ChannelResponse) error
Send ...
func (*WebSocketServerWrapper) SendHeader ¶
func (ws *WebSocketServerWrapper) SendHeader(md metadata.MD) error
SendHeader ...
func (*WebSocketServerWrapper) SendMsg ¶
func (ws *WebSocketServerWrapper) SendMsg(m any) error
SendMsg ...
func (*WebSocketServerWrapper) SetHeader ¶
func (ws *WebSocketServerWrapper) SetHeader(md metadata.MD) error
SetHeader ...
func (*WebSocketServerWrapper) SetTrailer ¶
func (ws *WebSocketServerWrapper) SetTrailer(md metadata.MD)
SetTrailer ...
func (*WebSocketServerWrapper) WebSocketConnect ¶
func (ws *WebSocketServerWrapper) WebSocketConnect(w http.ResponseWriter, r *http.Request)
WebSocketConnect handles WebSocket connections