1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-17 04:30:03 +02:00

Documentation

This commit is contained in:
Henrik Hautakoski 2024-02-01 11:27:42 +01:00
parent 6da433dc4d
commit 2b252ea24a
3 changed files with 8 additions and 2 deletions

View file

@ -7,10 +7,15 @@ import (
"time"
)
// Store time function in a variable.
// Makes it easy to travel in time when testing.
var now = time.Now
type memoryStoreItem struct {
value any
// Actual value stored.
value any
// Cache expiration time.
expired time.Time
}

1
app/cache/store.go vendored
View file

@ -5,6 +5,7 @@ import (
"time"
)
// Interface to a cache storage.
type Store interface {
// Set an item in the store.
Set(ctx context.Context, key string, value any, TTL time.Duration) error

View file

@ -74,7 +74,7 @@ func SpawnProccessor(shipStream *shipclient.Stream, loader StateLoader, saver St
shipStream.BlockHandler = processor.processBlock
shipStream.InitHandler = processor.initHandler
// Needed because if nil, traces will not be included in the response from ship.
// Needed because if nil, traces/table deltas will not be included in the response from ship.
shipStream.TraceHandler = func([]*ship.TransactionTraceV0) {}
shipStream.TableDeltaHandler = func([]*ship.TableDeltaV0) {}