MCPcopy Index your code
hub / github.com/FunctionStream/function-stream / GetState

Method GetState

fs/statestore/pebble.go:71–86  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

69}
70
71func (s *PebbleStateStore) GetState(key string) ([]byte, error) {
72 s.log.Debug("GetState", slog.String("key", key))
73 value, closer, err := s.db.Get([]byte(key))
74 if err != nil {
75 if errors.Is(err, pebble.ErrNotFound) {
76 return nil, api.ErrNotFound
77 }
78 return nil, err
79 }
80 result := make([]byte, len(value))
81 copy(result, value)
82 if err := closer.Close(); err != nil {
83 return nil, err
84 }
85 return result, nil
86}
87
88func (s *PebbleStateStore) Close() error {
89 return s.db.Close()

Callers

nothing calls this directly

Calls 4

DebugMethod · 0.80
CloseMethod · 0.65
StringMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected