Documentation
¶
Overview ¶
Package comparecache is a server-private SQLite convenience store for comparison rows. It is not evidence or authority: every page read must re-authorize the retained snapshots that produced the comparison.
Index ¶
Constants ¶
View Source
const ( DefaultByteCap = 32 << 20 DefaultTTL = 24 * time.Hour DefaultLimit = 50 )
Variables ¶
View Source
var ( ErrNotConfigured = errors.New("comparison cache is not configured") ErrNotFound = errors.New("cached comparison not found") )
Functions ¶
func ID ¶
func ID(left, right apicontract.ExecutionRef) string
ID derives the cache key from the two execution receipts already present on CompareResult. Core does not mint a separate comparison identifier.
Types ¶
type BeginRequest ¶
type BeginRequest struct {
PolicyFingerprint string
QueryID string
Left apicontract.ExecutionRef
Right apicontract.ExecutionRef
}
type CachedDelta ¶
type CachedDelta struct {
Column string `json:"column"`
Value apicontract.TypedValue `json:"value,omitempty"`
Absent bool `json:"absent,omitempty"`
}
type CachedRow ¶
type CachedRow struct {
SortKey string `json:"sortKey"`
Key []apicontract.TypedValue `json:"key"`
Row []apicontract.TypedValue `json:"row"`
Deltas []CachedDelta `json:"deltas,omitempty"`
}
type Meta ¶
type Meta struct {
PolicyFingerprint string
ComparisonID string
QueryID string
Left apicontract.ExecutionRef
Right apicontract.ExecutionRef
Columns []apicontract.Column
Key []string
}
type Page ¶
type Page struct {
ComparisonID string `json:"comparisonId"`
State string `json:"state"`
QueryID string `json:"queryId"`
Left apicontract.ExecutionRef `json:"left"`
Right apicontract.ExecutionRef `json:"right"`
Columns []apicontract.Column `json:"columns"`
Key []string `json:"key"`
Rows []CachedRow `json:"rows"`
NextSortKey string `json:"nextSortKey,omitempty"`
Truncated bool `json:"truncated"`
}
type PageRequest ¶
type PageRequest struct {
PolicyFingerprint string
ComparisonID string
State recordsetcompare.RecordState
After string
Limit int
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Begin ¶
func (s *Store) Begin(ctx context.Context, req BeginRequest) (*WriteSession, error)
type WriteSession ¶
type WriteSession struct {
// contains filtered or unexported fields
}
func (*WriteSession) Abort ¶
func (s *WriteSession) Abort()
func (*WriteSession) Commit ¶
func (s *WriteSession) Commit(result apicontract.CompareResult) error
func (*WriteSession) Observer ¶
func (s *WriteSession) Observer() recordsetcompare.RecordObserver
Click to show internal directories.
Click to hide internal directories.