MCPcopy
hub / github.com/wavetermdev/waveterm / EventPublishCommand

Method EventPublishCommand

pkg/wshrpc/wshserver/wshserver.go:510–520  ·  view source on GitHub ↗
(ctx context.Context, data wps.WaveEvent)

Source from the content-addressed store, hash-verified

508}
509
510func (ws *WshServer) EventPublishCommand(ctx context.Context, data wps.WaveEvent) error {
511 rpcSource := wshutil.GetRpcSourceFromContext(ctx)
512 if rpcSource == "" {
513 return fmt.Errorf("no rpc source set")
514 }
515 if data.Sender == "" {
516 data.Sender = rpcSource
517 }
518 wps.Broker.Publish(data)
519 return nil
520}
521
522func (ws *WshServer) EventSubCommand(ctx context.Context, data wps.SubscriptionRequest) error {
523 rpcSource := wshutil.GetRpcSourceFromContext(ctx)

Callers

nothing calls this directly

Calls 2

GetRpcSourceFromContextFunction · 0.92
PublishMethod · 0.80

Tested by

no test coverage detected