Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultPath() (string, error)
- func VersionID(diffID, revision string) string
- type Binding
- type ContextInfo
- type SQLiteQueue
- func (queue *SQLiteQueue) Accept(ctx context.Context, owner string, request ingestion.Request) (ingestionqueue.Job, error)
- func (queue *SQLiteQueue) Claim(ctx context.Context, duration time.Duration) (ingestionqueue.Delivery, error)
- func (queue *SQLiteQueue) Complete(ctx context.Context, delivery ingestionqueue.Delivery, id string) error
- func (queue *SQLiteQueue) Fail(ctx context.Context, delivery ingestionqueue.Delivery, detail string) error
- func (queue *SQLiteQueue) Get(ctx context.Context, owner, id string) (ingestionqueue.Job, error)
- func (queue *SQLiteQueue) Renew(ctx context.Context, delivery ingestionqueue.Delivery, duration time.Duration) error
- func (queue *SQLiteQueue) Retry(ctx context.Context, delivery ingestionqueue.Delivery, next time.Time, ...) error
- type SessionAssociation
- type Store
- func (store *Store) AuthenticateToken(token string) (User, error)
- func (store *Store) ClearMarks(contextID string, scope review.DiffMode) error
- func (store *Store) Close() error
- func (store *Store) Comments(contextID string) ([]review.ReviewComment, error)
- func (store *Store) Context(ownerID, id string, now time.Time) (ContextInfo, error)
- func (store *Store) ContextBinding(ownerID, id string, now time.Time) (Binding, error)
- func (store *Store) ContextCount(ownerID string, now time.Time) (int, error)
- func (store *Store) Contexts(ownerID string, limit int, beforeTime int64, beforeID string, now time.Time) ([]ContextInfo, error)
- func (store *Store) DeleteComment(contextID, commentID string) (bool, error)
- func (store *Store) DeleteComments(contextID string, selected map[string]bool) (int, error)
- func (store *Store) DeleteContext(ownerID, id string) error
- func (store *Store) DeleteMark(contextID string, scope review.DiffMode, fileID string) error
- func (store *Store) EnsureRemoteUser(account, token string) (User, error)
- func (store *Store) ImportComments(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(contextID string, scope review.DiffMode) ([]review.ReviewMark, error)
- func (store *Store) Observation(ownerID, contextID string) (ingestion.Metadata, error)
- func (store *Store) ObservationContexts(ownerID string, limit int, beforeTime int64, beforeID string, ...) ([]ContextInfo, error)
- func (store *Store) ObservationPatch(ownerID, contextID string, mode review.DiffMode, fileID string) (review.FilePatch, error)
- func (store *Store) ObservationSnapshot(ownerID, contextID string, mode review.DiffMode) (review.RepositoryDiff, error)
- func (store *Store) ProvisionUser(account, token string) (User, error)
- func (store *Store) PruneExpired(now time.Time) error
- func (store *Store) PutComment(contextID string, comment review.ReviewComment) error
- func (store *Store) PutMark(contextID string, mark review.ReviewMark) error
- func (store *Store) Queue() *SQLiteQueue
- func (store *Store) RemoteUsers() ([]User, error)
- func (store *Store) StoredVersion(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 ErrAuthentication = errors.New("invalid credentials")
var ErrNotFound = reviewdata.ErrNotFound
Functions ¶
func DefaultPath ¶
Types ¶
type Binding ¶
type Binding = reviewdata.Binding
type ContextInfo ¶
type ContextInfo = reviewdata.ContextInfo
type SQLiteQueue ¶
type SQLiteQueue struct {
// contains filtered or unexported fields
}
SQLiteQueue uses the same database owner as observations; it never opens a second connection pool or permits multiple processes to bypass store ownership.
func (*SQLiteQueue) Accept ¶
func (queue *SQLiteQueue) Accept(ctx context.Context, owner string, request ingestion.Request) (ingestionqueue.Job, error)
func (*SQLiteQueue) Claim ¶
func (queue *SQLiteQueue) Claim(ctx context.Context, duration time.Duration) (ingestionqueue.Delivery, error)
func (*SQLiteQueue) Complete ¶
func (queue *SQLiteQueue) Complete(ctx context.Context, delivery ingestionqueue.Delivery, id string) error
func (*SQLiteQueue) Fail ¶
func (queue *SQLiteQueue) Fail(ctx context.Context, delivery ingestionqueue.Delivery, detail string) error
func (*SQLiteQueue) Get ¶
func (queue *SQLiteQueue) Get(ctx context.Context, owner, id string) (ingestionqueue.Job, error)
func (*SQLiteQueue) Renew ¶
func (queue *SQLiteQueue) Renew(ctx context.Context, delivery ingestionqueue.Delivery, duration time.Duration) error
type SessionAssociation ¶
type SessionAssociation = reviewdata.SessionAssociation
SessionAssociation records observation, never ownership or authorship.
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) Comments ¶
func (store *Store) Comments(contextID string) ([]review.ReviewComment, error)
func (*Store) ContextBinding ¶
func (*Store) ContextCount ¶
func (*Store) Contexts ¶
func (store *Store) Contexts(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 retained review data. Stream heads intentionally survive so older observations remain stale.
func (*Store) DeleteMark ¶
func (*Store) EnsureRemoteUser ¶
EnsureRemoteUser bootstraps credentials, but never changes existing credentials.
func (*Store) ImportComments ¶
func (store *Store) ImportComments(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) Observation ¶
func (*Store) ObservationContexts ¶
func (store *Store) ObservationContexts(ownerID string, limit int, beforeTime int64, beforeID string, filter ingestion.Filter) ([]ContextInfo, error)
ObservationContexts filters immutable observations using captured metadata.
func (*Store) ObservationPatch ¶
func (*Store) ObservationSnapshot ¶
func (*Store) ProvisionUser ¶
ProvisionUser explicitly creates a new remote account. Tokens are stored hashed.
func (*Store) PutComment ¶
func (store *Store) PutComment(contextID string, comment review.ReviewComment) error
func (*Store) Queue ¶
func (store *Store) Queue() *SQLiteQueue
func (*Store) RemoteUsers ¶
func (*Store) StoredVersion ¶
type User ¶
type User = reviewdata.User