MCPcopy
hub / github.com/dagger/dagger / Store

Method Store

cmd/dagger/shell_state.go:84–90  ·  view source on GitHub ↗

Store saves a state instance and returns its key. This always generates a new key for immutability.

(st ShellState)

Source from the content-addressed store, hash-verified

82//
83// This always generates a new key for immutability.
84func (s *ShellStateStore) Store(st ShellState) string {
85 st.Key = rand.Text()
86 s.mu.Lock()
87 s.data[st.Key] = st
88 s.mu.Unlock()
89 return st.Key
90}
91
92// Get returns a state instance by key.
93func (s *ShellStateStore) Get(key string) (ShellState, bool) {

Calls 1

TextMethod · 0.45