Documentation ¶
Index ¶
Constants ¶
View Source
const (
KeyTokenFormatString = "WORMSCAN:NOTIONAL:TOKEN:%s"
)
Variables ¶
View Source
var ( ErrNotFound = errors.New("NOT FOUND") ErrInvalidCacheField = errors.New("INVALID CACHE FIELD") )
Functions ¶
This section is empty.
Types ¶
type DummyNotionalCache ¶
type DummyNotionalCache struct { }
DummyNotionalCache is a dummy notional cache.
func NewDummyNotionalCache ¶
func NewDummyNotionalCache() *DummyNotionalCache
NewDummyNotionalCache init a new dummy notional cache.
func (*DummyNotionalCache) Close ¶
func (c *DummyNotionalCache) Close() error
Close the dummy cache.
type NotionalCache ¶
type NotionalCache struct {
// contains filtered or unexported fields
}
NotionalCacheClient redis cache client.
func NewNotionalCache ¶
func NewNotionalCache(ctx context.Context, redisClient *redis.Client, prefix string, channel string, log *zap.Logger) (*NotionalCache, error)
NewNotionalCache create a new cache client. After create a NotionalCache use the Init method to initialize pubsub and load the cache.
type NotionalLocalCacheReadable ¶
NotionalLocalCacheReadable is the interface for notional local cache.
type PriceData ¶
type PriceData struct { NotionalUsd decimal.Decimal `json:"notional_usd"` UpdatedAt time.Time `json:"updated_at"` }
PriceData is the notional value of assets in cache.
func (PriceData) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
This function is used when the notional job writes data to redis.
Click to show internal directories.
Click to hide internal directories.