Documentation
¶
Index ¶
Constants ¶
View Source
const ( InvocationNotFoundErrorName = "InvocationNotFound" ReceiptNotFoundErrorName = "ReceiptNotFound" )
Variables ¶
View Source
var ( // ErrInvocationNotFound indicates an invocation was not found that matches the passed details. ErrInvocationNotFound = errors.New(InvocationNotFoundErrorName, "invocation not found") // ErrReceiptNotFound indicates a receipt was not found that matches the passed details. ErrReceiptNotFound = errors.New(ReceiptNotFoundErrorName, "receipt not found") )
Functions ¶
func Index ¶
func Index(message message.AgentMessage) iter.Seq2[IndexEntry, error]
Types ¶
type IndexEntry ¶
type IndexEntry struct {
Invocation *InvocationSource
Receipt *ReceiptSource
}
IndexEntry is either an indexed invocation OR an indexed receipt.
type InvocationSource ¶
type InvocationSource struct {
Task cid.Cid
Invocation invocation.Invocation
Message cid.Cid
}
type ReceiptSource ¶
type Store ¶
type Store interface {
// Write an agent message to the store.
Write(ctx context.Context, message message.AgentMessage, index []IndexEntry, source []byte) error
// GetInvocation retrieves an invocation by its task CID. May return [ErrInvocationNotFound].
GetInvocation(ctx context.Context, task cid.Cid) (invocation.Invocation, error)
// GetReceipt retrieves a receipt by its task CID. May return [ErrReceiptNotFound].
GetReceipt(ctx context.Context, task cid.Cid) (receipt.AnyReceipt, error)
}
Click to show internal directories.
Click to hide internal directories.