MCPcopy
hub / github.com/TarsCloud/TarsGo / GetDyeingKey

Function GetDyeingKey

tars/util/current/tarscurrent.go:223–234  ·  view source on GitHub ↗

GetDyeingKey gets dyeing key from the context.

(ctx context.Context)

Source from the content-addressed store, hash-verified

221
222// GetDyeingKey gets dyeing key from the context.
223func GetDyeingKey(ctx context.Context) (string, bool) {
224 tc, ok := currentFromContext(ctx)
225 if ok {
226 if tc.reqStatus != nil {
227 if dyeingKey, exists := tc.reqStatus[StatusDyedKey]; exists {
228 return dyeingKey, true
229 }
230 }
231 }
232
233 return "", false
234}
235
236// SetDyeingKey set dyeing key to the tars current.
237func SetDyeingKey(ctx context.Context, dyeingKey string) bool {

Callers 2

TarsInvokeMethod · 0.92
DyeingWritefMethod · 0.92

Calls 1

currentFromContextFunction · 0.85

Tested by

no test coverage detected