MCPcopy
hub / github.com/nats-io/nats.go / respToken

Method respToken

nats.go:4782–4787  ·  view source on GitHub ↗

respToken will return the last token of a literal response inbox which we use for the message channel lookup. This needs to verify the subject prefix matches to protect itself against the server changing the subject. Lock should be held.

(respInbox string)

Source from the content-addressed store, hash-verified

4780// prefix matches to protect itself against the server changing the subject.
4781// Lock should be held.
4782func (nc *Conn) respToken(respInbox string) string {
4783 if token, found := strings.CutPrefix(respInbox, nc.respSubPrefix); found {
4784 return token
4785 }
4786 return ""
4787}
4788
4789// Subscribe will express interest in the given subject. The subject
4790// can have wildcards.

Callers 1

respHandlerMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected