Documentation
¶
Index ¶
- Constants
- Variables
- func Reset(path string) (string, error)
- func VersionID(diffID, revision string) string
- type Binding
- type ContextInfo
- type SessionAssociation
- type StateError
- type Store
- func (store *Store) ClearMarks(ctx context.Context, contextID string, scope review.DiffMode) error
- func (store *Store) Close() error
- func (store *Store) Comments(ctx context.Context, contextID string) ([]review.ReviewComment, error)
- func (store *Store) Context(ctx context.Context, ownerID, id string, now time.Time) (ContextInfo, error)
- func (store *Store) ContextBinding(ctx context.Context, ownerID, id string, now time.Time) (Binding, error)
- func (store *Store) ContextCount(ctx context.Context, ownerID string, selection ingestion.Selection, ...) (int, error)
- func (store *Store) Contexts(ctx context.Context, ownerID string, limit int, beforeTime int64, ...) ([]ContextInfo, error)
- func (store *Store) DeleteComment(ctx context.Context, contextID, commentID string) (bool, error)
- func (store *Store) DeleteComments(ctx context.Context, contextID string, selected map[string]bool) (int, error)
- func (store *Store) DeleteContext(ctx context.Context, ownerID, id string) error
- func (store *Store) DeleteMark(ctx context.Context, contextID string, scope review.DiffMode, fileID string) error
- func (store *Store) ImportComments(ctx context.Context, contextID string, comments []review.ReviewComment) ([]review.ReviewComment, error)
- func (store *Store) Ingest(ownerID string, request ingestion.Request) (Binding, error)
- func (store *Store) IngestContext(ctx context.Context, ownerID string, request ingestion.Request) (Binding, error)
- func (store *Store) Marks(ctx context.Context, contextID string, scope review.DiffMode) ([]review.ReviewMark, error)
- func (store *Store) Observation(ownerID, contextID string) (ingestion.Metadata, error)
- func (store *Store) ObservationCommitFileVersion(ctx context.Context, ownerID, contextID, oid, fileID string) (reviewdata.FileVersion, error)
- func (store *Store) ObservationCommitPatch(ctx context.Context, ownerID, contextID, oid, fileID, fileVersion string) (review.FilePatch, error)
- func (store *Store) ObservationCommitSnapshot(ctx context.Context, ownerID, contextID, oid string) (review.RepositoryDiff, error)
- func (store *Store) ObservationCommits(ctx context.Context, ownerID, contextID string) ([]review.CommitSummary, review.CommitRange, error)
- func (store *Store) ObservationContexts(ctx context.Context, ownerID string, limit int, beforeTime int64, ...) ([]ContextInfo, error)
- func (store *Store) ObservationFileVersion(ctx context.Context, ownerID, contextID string, mode review.DiffMode, ...) (reviewdata.FileVersion, error)
- func (store *Store) ObservationPatch(ctx context.Context, ownerID, contextID string, mode review.DiffMode, ...) (review.FilePatch, error)
- func (store *Store) ObservationSnapshot(ctx context.Context, ownerID, contextID string, mode review.DiffMode) (review.RepositoryDiff, error)
- func (store *Store) PruneExpired(now time.Time) error
- func (store *Store) PutComment(ctx context.Context, contextID string, comment review.ReviewComment) error
- func (store *Store) PutMark(ctx context.Context, contextID string, mark review.ReviewMark) error
- func (store *Store) ReplaceComment(ctx context.Context, contextID string, comment review.ReviewComment) (bool, error)
- func (store *Store) StoredVersion(ctx context.Context, ownerID, diffID, versionID string, now time.Time) (review.RepositoryDiff, error)
- func (store *Store) User(osUID, name string) (User, error)
- type User
Constants ¶
const DefaultRetention = 7 * 24 * time.Hour
Variables ¶
var ( ErrExpired = reviewdata.ErrExpired ErrSubmissionConflict = reviewdata.ErrSubmissionConflict )
var ErrNotFound = reviewdata.ErrNotFound
Functions ¶
func Reset ¶ added in v0.2.1
Reset moves current or older diffx state at path to a timestamped backup beside it, then removes earlier backups. It refuses newer or unrecognized state and returns "" when no state exists. Opening a store never resets; only entry points that own an explicit reset decision call Reset.
Types ¶
type Binding ¶
type Binding = reviewdata.Binding
type ContextInfo ¶
type ContextInfo = reviewdata.ContextInfo
type SessionAssociation ¶
type SessionAssociation = reviewdata.SessionAssociation
SessionAssociation records observation, never ownership or authorship.
type StateError ¶ added in v0.2.1
StateError reports state this binary refuses to open. Version is the stored schema; it is zero for unversioned or unrecognized files.
func (*StateError) Error ¶ added in v0.2.1
func (failure *StateError) Error() string
func (*StateError) Older ¶ added in v0.2.1
func (failure *StateError) Older() bool
Older reports diffx state written by an earlier schema that cannot upgrade in place.
func (*StateError) Supported ¶ added in v0.2.1
func (failure *StateError) Supported() int
Supported is the schema this binary opens.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func OpenWithRetention ¶
OpenWithRetention configures expiry for new observations. Existing expiry and replay identities remain unchanged.
func (*Store) ClearMarks ¶
func (*Store) ContextBinding ¶
func (*Store) ContextCount ¶
func (*Store) Contexts ¶
func (store *Store) Contexts(ctx context.Context, ownerID string, limit int, beforeTime int64, beforeID string, now time.Time) ([]ContextInfo, error)
Contexts uses a keyset cursor; concurrent submissions may move an item across pages.
func (*Store) DeleteComment ¶
func (*Store) DeleteComments ¶
func (*Store) DeleteContext ¶
DeleteContext removes the context and every scope's snapshot. Review state survives while its stream has another observation. Stream heads intentionally survive so older observations remain stale.
func (*Store) DeleteMark ¶
func (store *Store) DeleteMark(ctx context.Context, contextID string, scope review.DiffMode, fileID string) error
DeleteMark and ClearMarks remove only marks visible in this context.
func (*Store) ImportComments ¶
func (store *Store) ImportComments(ctx context.Context, contextID string, comments []review.ReviewComment) ([]review.ReviewComment, error)
func (*Store) Ingest ¶
Ingest atomically commits an immutable observation and its retry identity. Checkout paths are labels; this method never accesses a producer filesystem.
func (*Store) IngestContext ¶
func (*Store) Marks ¶
func (store *Store) Marks(ctx context.Context, contextID string, scope review.DiffMode) ([]review.ReviewMark, error)
Marks returns stream marks whose file patch is unchanged in this context, projected onto this context's snapshot.
func (*Store) Observation ¶
func (*Store) ObservationCommitFileVersion ¶ added in v0.2.2
func (store *Store) ObservationCommitFileVersion(ctx context.Context, ownerID, contextID, oid, fileID string) (reviewdata.FileVersion, error)
ObservationCommitFileVersion reads only indexed identities of a commit's file.
func (*Store) ObservationCommitPatch ¶ added in v0.2.2
func (*Store) ObservationCommitSnapshot ¶ added in v0.2.2
func (store *Store) ObservationCommitSnapshot(ctx context.Context, ownerID, contextID, oid string) (review.RepositoryDiff, error)
ObservationCommitSnapshot reads a captured commit's diff. Merge commits and commits outside the observation are not found.
func (*Store) ObservationCommits ¶ added in v0.2.2
func (store *Store) ObservationCommits(ctx context.Context, ownerID, contextID string) ([]review.CommitSummary, review.CommitRange, error)
ObservationCommits lists an unexpired observation's captured commits, oldest first, with the count of omitted older commits.
func (*Store) ObservationContexts ¶
func (store *Store) ObservationContexts(ctx context.Context, ownerID string, limit int, beforeTime int64, beforeID string, filter ingestion.Filter) ([]ContextInfo, error)
ObservationContexts filters immutable observations using captured metadata.
func (*Store) ObservationFileVersion ¶ added in v0.2.1
func (store *Store) ObservationFileVersion(ctx context.Context, ownerID, contextID string, mode review.DiffMode, fileID string) (reviewdata.FileVersion, error)
ObservationFileVersion reads only indexed identities. Missing files retain the scope identity so callers can reject stale scope references before file errors.
func (*Store) ObservationPatch ¶
func (*Store) ObservationSnapshot ¶
func (*Store) PutComment ¶
func (store *Store) PutComment(ctx context.Context, contextID string, comment review.ReviewComment) error
PutComment stores a comment in the context's stream review. New references must name this context's snapshot; an existing comment may keep the snapshot it was written against.
func (*Store) ReplaceComment ¶ added in v0.2.1
func (store *Store) ReplaceComment(ctx context.Context, contextID string, comment review.ReviewComment) (bool, error)
ReplaceComment updates an existing stream comment and reports false when it no longer exists, so an edit racing a delete cannot recreate the comment.
func (*Store) StoredVersion ¶
type User ¶
type User = reviewdata.User