MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / InitBadgeStore

Function InitBadgeStore

pkg/wcore/badge.go:31–42  ·  view source on GitHub ↗

InitBadgeStore subscribes to incoming badge events.

()

Source from the content-addressed store, hash-verified

29
30// InitBadgeStore subscribes to incoming badge events.
31func InitBadgeStore() error {
32 log.Printf("initializing badge store\n")
33
34 rpcClient := wshclient.GetBareRpcClient()
35 rpcClient.EventListener.On(wps.Event_Badge, handleBadgeEvent)
36 wshclient.EventSubCommand(rpcClient, wps.SubscriptionRequest{
37 Event: wps.Event_Badge,
38 AllScopes: true,
39 }, nil)
40
41 return nil
42}
43
44func handleBadgeEvent(event *wps.WaveEvent) {
45 if event.Event != wps.Event_Badge {

Callers 1

mainFunction · 0.92

Calls 3

GetBareRpcClientFunction · 0.92
EventSubCommandFunction · 0.92
OnMethod · 0.80

Tested by

no test coverage detected