Documentation
¶
Overview ¶
Package remoteresults defines the durable import boundary for node journals.
Index ¶
- Constants
- Variables
- func CheckEventBudget(raw []byte) error
- func CheckPerformanceBudget(raw []byte) error
- func CheckRunReportBudget(raw []byte) error
- type Batch
- type DocumentClass
- type DocumentCursor
- type DocumentPage
- type DocumentQuery
- type DocumentReference
- type DocumentWork
- type Mirror
- type Origin
- type PerformanceDocumentImport
- type PriorityPage
- type Repository
- type RunReportImport
- type WorkRepository
Constants ¶
const ( MaxEventCollectionItems = 32_768 MaxReportCollectionItems = 131_072 // 10000 samples may contribute up to 30000 sparse time slices. Preserve // their complete DTOs within the independent 32 MiB archive byte budget. MaxPerformanceCollectionItems = 4_194_304 )
Variables ¶
var ( ErrInvalid = errors.New("invalid remote result batch") ErrConflict = errors.New("remote result identity or content conflict") ErrNotFound = errors.New("remote result mirror not found") )
var ErrCollectionBudget = errors.New("remote result exceeds collection budget")
Functions ¶
func CheckEventBudget ¶
CheckEventBudget bounds allocations before any typed domain decoding.
func CheckPerformanceBudget ¶
func CheckRunReportBudget ¶
Types ¶
type Batch ¶
type Batch struct {
Origin Origin
JobID string
AfterSequence uint64
Events []jobcontract.Event
}
type DocumentClass ¶
type DocumentClass string
const ( DocumentFocus DocumentClass = "focus" DocumentHistory DocumentClass = "history" )
type DocumentCursor ¶
type DocumentCursor struct {
JobID string
ReferenceType jobcontract.EventKind
ReportID string
}
func (DocumentCursor) Validate ¶
func (cursor DocumentCursor) Validate() error
type DocumentPage ¶
type DocumentPage struct {
Items []DocumentWork
NextCursor DocumentCursor
HasMore bool
}
type DocumentQuery ¶
type DocumentQuery struct {
Origin Origin
Class DocumentClass
After DocumentCursor
Limit uint32
}
func (DocumentQuery) Validate ¶
func (query DocumentQuery) Validate() error
type DocumentReference ¶
type DocumentReference struct {
Kind jobcontract.EventKind `json:"kind"`
Reference jobcontract.ReportReference `json:"reference"`
Imported bool `json:"imported"`
}
Kind distinguishes the complete PerformanceResult from its optional archive. Reference always identifies the original bytes; Imported does not imply that separate evidence or attachment files have been downloaded.
type DocumentWork ¶
type DocumentWork struct {
JobID string
Document DocumentReference
}
type Mirror ¶
type Mirror struct {
Origin Origin `json:"origin"`
Spec jobcontract.JobSpec `json:"spec"`
Snapshot jobcontract.Snapshot `json:"snapshot"`
}
type Origin ¶
type Origin struct {
ConfigurationID string `json:"configuration_id"`
NodeID string `json:"node_id"`
InstallationID string `json:"installation_id"`
}
ConfigurationID identifies the local node record. NodeID and InstallationID identify the actual server and never change when an observer reconnects.
type PerformanceDocumentImport ¶
type PerformanceDocumentImport struct {
Origin Origin
JobID string
Kind jobcontract.EventKind
Document []byte
}
type PriorityPage ¶
PriorityPage contains bounded active shared-job IDs used as scheduling hints. Terminal jobs leave fact priority; history still revisits them for late facts. The page does not authenticate or project remote execution facts.
type Repository ¶
type Repository interface {
ApplyRemoteBatch(context.Context, Batch) (Mirror, error)
GetRemoteMirror(context.Context, string) (Mirror, error)
ImportRemoteRunReport(context.Context, RunReportImport) error
RemoteRunReportImported(context.Context, string, string) (bool, error)
ImportRemotePerformanceDocument(context.Context, PerformanceDocumentImport) error
ReadRemotePerformanceResult(context.Context, string) (jobcontract.PerformanceResult, error)
ListRemoteDocuments(context.Context, string) ([]DocumentReference, error)
}
type RunReportImport ¶
type WorkRepository ¶
type WorkRepository interface {
ListRemoteFactPriorityIDs(context.Context, Origin, string, uint32) (PriorityPage, error)
ListRemoteDocumentWork(context.Context, DocumentQuery) (DocumentPage, error)
}
WorkRepository returns scheduling hints. Import still authenticates the durable source, immutable reference, original bytes and typed document.