mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-04 12:03:41 +02:00
Documentation
This commit is contained in:
parent
6da433dc4d
commit
2b252ea24a
3 changed files with 8 additions and 2 deletions
5
app/cache/memory_store.go
vendored
5
app/cache/memory_store.go
vendored
|
|
@ -7,10 +7,15 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Store time function in a variable.
|
||||||
|
// Makes it easy to travel in time when testing.
|
||||||
var now = time.Now
|
var now = time.Now
|
||||||
|
|
||||||
type memoryStoreItem struct {
|
type memoryStoreItem struct {
|
||||||
|
// Actual value stored.
|
||||||
value any
|
value any
|
||||||
|
|
||||||
|
// Cache expiration time.
|
||||||
expired time.Time
|
expired time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
1
app/cache/store.go
vendored
1
app/cache/store.go
vendored
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Interface to a cache storage.
|
||||||
type Store interface {
|
type Store interface {
|
||||||
// Set an item in the store.
|
// Set an item in the store.
|
||||||
Set(ctx context.Context, key string, value any, TTL time.Duration) error
|
Set(ctx context.Context, key string, value any, TTL time.Duration) error
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ func SpawnProccessor(shipStream *shipclient.Stream, loader StateLoader, saver St
|
||||||
shipStream.BlockHandler = processor.processBlock
|
shipStream.BlockHandler = processor.processBlock
|
||||||
shipStream.InitHandler = processor.initHandler
|
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.TraceHandler = func([]*ship.TransactionTraceV0) {}
|
||||||
shipStream.TableDeltaHandler = func([]*ship.TableDeltaV0) {}
|
shipStream.TableDeltaHandler = func([]*ship.TableDeltaV0) {}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue