Documentation ¶
Index ¶
- func HashOrigin(moduleID t.ModuleID, itemID ItemID) *hasherpbtypes.HashOrigin
- func Origin(itemID ItemID) *contextstorepbtypes.Origin
- func SigVerOrigin(moduleID t.ModuleID, itemID ItemID) *cryptopbtypes.SigVerOrigin
- func SignOrigin(moduleID t.ModuleID, itemID ItemID) *cryptopbtypes.SignOrigin
- type ContextStore
- type ItemID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashOrigin ¶
func HashOrigin(moduleID t.ModuleID, itemID ItemID) *hasherpbtypes.HashOrigin
HashOrigin returns a HashOrigin protobuf containing moduleID and contextstore.Origin(itemID).
func Origin ¶
func Origin(itemID ItemID) *contextstorepbtypes.Origin
Origin returns a contextstorepb.Origin protobuf containing the given id.
func SigVerOrigin ¶
func SigVerOrigin(moduleID t.ModuleID, itemID ItemID) *cryptopbtypes.SigVerOrigin
SigVerOrigin returns a SigVerOrigin protobuf containing moduleID and contextstore.Origin(itemID).
func SignOrigin ¶
func SignOrigin(moduleID t.ModuleID, itemID ItemID) *cryptopbtypes.SignOrigin
SignOrigin returns a SignOrigin protobuf containing moduleID and contextstore.Origin(itemID).
Types ¶
type ContextStore ¶
type ContextStore[T any] interface { // Store stores the given data in the ContextStore and returns a unique id. // The data can be later recovered or disposed of using this id. Store(t T) ItemID // Recover returns the data stored under the provided id. // Note that the data will continue to exist in the ContextStore. // In order to dispose of the data, call s.Dispose(id) or s.RecoverAndDispose(id). Recover(id ItemID) T // Dispose removes the data from the ContextStore. Dispose(id ItemID) // RecoverAndDispose returns the data stored under the provided id and removes it from the ContextStore. RecoverAndDispose(id ItemID) T }
ContextStore can be used to store arbitrary data under an automatically deterministically generated unique id.
func NewSequentialContextStore ¶
func NewSequentialContextStore[T any]() ContextStore[T]
NewSequentialContextStore creates an empty ContextStore that can only be accessed sequentially.
Click to show internal directories.
Click to hide internal directories.