MCPcopy Create free account
hub / github.com/apache/dubbo-go / SetAttachment

Method SetAttachment

protocol/invocation/rpcinvocation.go:182–189  ·  view source on GitHub ↗
(key string, value any)

Source from the content-addressed store, hash-verified

180}
181
182func (r *RPCInvocation) SetAttachment(key string, value any) {
183 r.lock.Lock()
184 defer r.lock.Unlock()
185 if r.attachments == nil {
186 r.attachments = make(map[string]any)
187 }
188 r.attachments[key] = value
189}
190
191func (r *RPCInvocation) GetAttachment(key string) (string, bool) {
192 r.lock.RLock()

Calls 2

LockMethod · 0.80
UnlockMethod · 0.80

Tested by 4

TestRouteAttachmentsFunction · 0.76
TestRouteRangePatternFunction · 0.76