MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / Get

Method Get

database/transactions_test.go:53–63  ·  view source on GitHub ↗
(ctx context.Context, key string, data interface{})

Source from the content-addressed store, hash-verified

51}
52
53func (m *mockCache) Get(ctx context.Context, key string, data interface{}) error {
54 if v, ok := m.data[key]; ok {
55 // For simplicity, just return the value directly
56 switch d := data.(type) {
57 case *[]*model.Transaction:
58 *d = v.([]*model.Transaction)
59 }
60 return nil
61 }
62 return errors.New("cache miss")
63}
64
65func (m *mockCache) Delete(ctx context.Context, key string) error {
66 delete(m.data, key)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected