Documentation ¶
Overview ¶
Package asset - Cache for assets
temporary store assets just received until they are: a. verified by having a corresponding issue verified b. confirmed by having a block broadcast containing them c. expired because no longer referenced by any issues
i.e. all isues were expired
Index ¶
- func Cache(asset *transactionrecord.AssetData, assetHandle storage.Handle) (*transactionrecord.AssetIdentifier, transactionrecord.Packed, error)
- func DecrementTTL(assetId transactionrecord.AssetIdentifier)
- func Delete(assetId transactionrecord.AssetIdentifier)
- func Exists(assetId transactionrecord.AssetIdentifier, assetHandle storage.Handle) bool
- func Finalise() error
- func Get(assetId transactionrecord.AssetIdentifier) transactionrecord.Packed
- func IncrementTTL(assetId transactionrecord.AssetIdentifier)
- func Initialise() error
- func SetVerified(assetId transactionrecord.AssetIdentifier)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cache ¶
func Cache(asset *transactionrecord.AssetData, assetHandle storage.Handle) (*transactionrecord.AssetIdentifier, transactionrecord.Packed, error)
Cache - cache an incoming asset
func DecrementTTL ¶ added in v0.11.0
func DecrementTTL(assetId transactionrecord.AssetIdentifier)
DecrementTTL - issue was expired so decrease lock count
func Delete ¶
func Delete(assetId transactionrecord.AssetIdentifier)
Delete - remove an asset from the cache
func Exists ¶
func Exists(assetId transactionrecord.AssetIdentifier, assetHandle storage.Handle) bool
Exists - check if an item confirmed in storage handle
func Get ¶
func Get(assetId transactionrecord.AssetIdentifier) transactionrecord.Packed
Get - get packed asset data from cache (nil if not present)
func IncrementTTL ¶ added in v0.11.0
func IncrementTTL(assetId transactionrecord.AssetIdentifier)
IncrementTTL - lock ass as used by one issue
func SetVerified ¶
func SetVerified(assetId transactionrecord.AssetIdentifier)
SetVerified - mark a cached asset being verified
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.