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

Method getLinkForRoute

pkg/wshutil/wshrouter.go:609–625  ·  view source on GitHub ↗

synchronized, returns a copy

(routeId string)

Source from the content-addressed store, hash-verified

607
608// synchronized, returns a copy
609func (router *WshRouter) getLinkForRoute(routeId string) *linkMeta {
610 if routeId == "" {
611 return nil
612 }
613 router.lock.Lock()
614 defer router.lock.Unlock()
615 linkId := router.routeMap[routeId]
616 if linkId == baseds.NoLinkId {
617 return nil
618 }
619 lm := router.linkMap[linkId]
620 if lm == nil {
621 return nil
622 }
623 lmCopy := *lm
624 return &lmCopy
625}
626
627func (router *WshRouter) GetLinkIdForRoute(routeId string) baseds.LinkId {
628 lm := router.getLinkForRoute(routeId)

Callers 4

SendEventMethod · 0.95
sendRoutedMessageMethod · 0.95
WaitForRegisterMethod · 0.95
GetLinkIdForRouteMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected