MCPcopy
hub / github.com/dagger/dagger / GetStateKey

Function GetStateKey

cmd/dagger/shell_state.go:55–65  ·  view source on GitHub ↗

GetStateKey returns the state key from a token. If input is not exactly a token, returns an empty string.

(in string)

Source from the content-addressed store, hash-verified

53//
54// If input is not exactly a token, returns an empty string.
55func GetStateKey(in string) string {
56 m := shellStatePattern.FindAllStringSubmatch(in, -1)
57 if len(m) != 1 {
58 return ""
59 }
60 token, key := m[0][0], m[0][1]
61 if token != in {
62 return ""
63 }
64 return key
65}
66
67// ShellStateStore manages state instances in memory concurrently.
68type ShellStateStore struct {

Callers 6

CallMethod · 0.85
ExecMethod · 0.85
loadInputMethod · 0.85
parseFlagValueMethod · 0.85
NewLLMSessionFunction · 0.85
syncVarsToLLMMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected