13 lines
313 B
Go
13 lines
313 B
Go
package trade
|
|
|
|
// Get retrieves and stores a value from peers
|
|
func (t *KV) Get(k string) (any, error) {
|
|
// debate over expiry of values or using a common KV interface...
|
|
// like using kvcache...
|
|
// try getting locally:
|
|
res, ok := t.local[k]
|
|
if !ok {
|
|
// for peer in peers, grab value:
|
|
}
|
|
return res, nil
|
|
}
|