MCPcopy Create free account
hub / github.com/GetStream/stream-go2 / RealtimeToken

Method RealtimeToken

feed.go:132–146  ·  view source on GitHub ↗

RealtimeToken returns a token that can be used client-side to listen in real-time to feed changes.

(readonly bool)

Source from the content-addressed store, hash-verified

130
131// RealtimeToken returns a token that can be used client-side to listen in real-time to feed changes.
132func (f *feed) RealtimeToken(readonly bool) string {
133 var action action
134 if readonly {
135 action = actionRead
136 } else {
137 action = actionWrite
138 }
139 id := f.client.authenticator.feedID(f)
140 claims := f.client.authenticator.jwtFeedClaims(resFeed, action, id)
141 token, err := f.client.authenticator.jwtSignatureFromClaims(claims)
142 if err != nil {
143 return ""
144 }
145 return token
146}

Callers

nothing calls this directly

Calls 3

feedIDMethod · 0.80
jwtFeedClaimsMethod · 0.80

Tested by

no test coverage detected