apiserver

package
v0.0.5 Latest Latest
Warning

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

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

Documentation

Index

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

Channel to the push server and receive streaming response

func (*PushServer) GetClientActiveDevices

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

SendEventToClientChannel sends event to a client

func (*PushServer) SendEventToClientDeviceChannel

SendEventToClientDeviceChannel sends event to a client with device

func (*PushServer) SendEventToTopic

SendEventToTopic sends event to a topic

func (*PushServer) SendEventToTopics

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

Recv ...

func (*WebSocketServerWrapper) RecvMsg

func (ws *WebSocketServerWrapper) RecvMsg(m any) error

RecvMsg ...

func (*WebSocketServerWrapper) Send

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

Jump to

Keyboard shortcuts

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