Documentation
¶
Index ¶
- Variables
- type Catalog
- func (catalog *Catalog) GetCommitDiff(ctx context.Context, id, oid string) (review.RepositoryDiff, error)
- func (catalog *Catalog) GetCommitPatch(ctx context.Context, id, oid, fileID string) (review.FilePatch, error)
- func (catalog *Catalog) GetCommits(ctx context.Context, id string) (CommitList, error)
- func (catalog *Catalog) GetDiff(ctx context.Context, id string, scope review.DiffMode) (review.RepositoryDiff, error)
- func (catalog *Catalog) GetPatch(ctx context.Context, id string, scope review.DiffMode, fileID string) (review.FilePatch, error)
- func (catalog *Catalog) ListContexts(ctx context.Context, limit int, cursor string, filter ingestion.Filter) (contextservice.Page, error)
- func (catalog *Catalog) Review(ctx context.Context, id string) (*Service, error)
- type Comment
- type CommentNotFoundError
- type CommentStore
- type CommitList
- type CommitStore
- type ContextProvider
- type CreateCommentInput
- type DeletedComments
- type ExportCommentsInput
- type MutationStore
- type Resolution
- type Service
- func (service *Service) CarryComment(ctx context.Context, commentID string) (review.ReviewComment, error)
- func (service *Service) ClearMarks(ctx context.Context, mode review.DiffMode) error
- func (service *Service) Comments(ctx context.Context) ([]review.ReviewComment, error)
- func (service *Service) CommitContents(ctx context.Context, oid, fileID, fileVersion string) (review.FileContents, error)
- func (service *Service) CommitPatch(ctx context.Context, oid, fileID, fileVersion string) (review.FilePatch, error)
- func (service *Service) CommitSnapshot(ctx context.Context, oid string) (review.RepositoryDiff, error)
- func (service *Service) Commits(ctx context.Context) (CommitList, error)
- func (service *Service) CreateComment(ctx context.Context, body CreateCommentInput) (review.ReviewComment, error)
- func (service *Service) CurrentContents(ctx context.Context, mode review.DiffMode, ...) (review.FileContents, error)
- func (service *Service) CurrentFile(ctx context.Context, mode review.DiffMode, ...) (review.RepositoryDiff, review.ChangedFile, error)
- func (service *Service) CurrentPatch(ctx context.Context, mode review.DiffMode, ...) (review.FilePatch, error)
- func (service *Service) DeleteComment(ctx context.Context, id string) (bool, error)
- func (service *Service) DeleteComments(ctx context.Context, selection string) (DeletedComments, error)
- func (service *Service) DeleteMark(ctx context.Context, mode review.DiffMode, id string) error
- func (service *Service) ExportComments(ctx context.Context, input ExportCommentsInput) (string, error)
- func (service *Service) ImportComments(ctx context.Context, input []review.ReviewComment) ([]review.ReviewComment, error)
- func (service *Service) ListComments(ctx context.Context, includeResolved bool) ([]Comment, error)
- func (service *Service) Marks(ctx context.Context, mode review.DiffMode) ([]review.ReviewMark, error)
- func (service *Service) OwnsDiff(id string) bool
- func (service *Service) Patch(ctx context.Context, mode review.DiffMode, fileID string) (review.FilePatch, error)
- func (service *Service) PutMark(ctx context.Context, mode review.DiffMode, ...) (review.ReviewMark, error)
- func (service *Service) ResolveComment(ctx context.Context, commentID string) (Resolution, error)
- func (service *Service) Session() reviewsession.Session
- func (service *Service) Snapshot(ctx context.Context, mode review.DiffMode) (review.RepositoryDiff, error)
- func (service *Service) UpdateComment(ctx context.Context, commentID string, body UpdateCommentInput) (review.ReviewComment, error)
- func (service *Service) Version(ctx context.Context, diffID, versionID string) (review.RepositoryDiff, error)
- type UpdateCommentInput
Constants ¶
This section is empty.
Variables ¶
var ErrCommentNotFound = errors.New("review comment not found")
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
func NewCatalog ¶
func NewCatalog(provider ContextProvider, store MutationStore) *Catalog
func (*Catalog) GetCommitDiff ¶ added in v0.2.2
func (*Catalog) GetCommitPatch ¶ added in v0.2.2
func (*Catalog) GetCommits ¶ added in v0.2.2
func (*Catalog) ListContexts ¶
type Comment ¶
type Comment struct {
review.ReviewComment
Applicability review.Applicability `json:"applicability"`
Actionable bool `json:"actionable"`
}
type CommentNotFoundError ¶
type CommentNotFoundError struct {
CommentID string
}
func (*CommentNotFoundError) Error ¶
func (err *CommentNotFoundError) Error() string
func (*CommentNotFoundError) Unwrap ¶
func (err *CommentNotFoundError) Unwrap() error
type CommentStore ¶
type CommitList ¶ added in v0.2.2
type CommitList struct {
Commits []review.CommitSummary `json:"commits"`
Omitted int `json:"omitted"`
}
CommitList is the context's captured commits, oldest first.
type CommitStore ¶ added in v0.2.2
type CommitStore interface {
ObservationCommits(context.Context, string, string) ([]review.CommitSummary, review.CommitRange, error)
ObservationCommitSnapshot(context.Context, string, string, string) (review.RepositoryDiff, error)
ObservationCommitFileVersion(context.Context, string, string, string, string) (reviewdata.FileVersion, error)
ObservationCommitPatch(context.Context, string, string, string, string, string) (review.FilePatch, error)
}
CommitStore reads an owner's captured branch commits. Commit diffs are a read-only lens: they carry no comments or reviewed marks.
type ContextProvider ¶
type ContextProvider interface {
ListFiltered(context.Context, int, string, ingestion.Filter) (contextservice.Page, error)
Resolve(context.Context, string) (reviewsession.Session, error)
}
ContextProvider must resolve IDs within the authenticated user's catalog. Resolve validates ownership and expiry before any review storage is accessed.
type CreateCommentInput ¶
type CreateCommentInput struct {
DiffID string `json:"diffId"`
VersionID string `json:"versionId"`
FileID string `json:"fileId"`
Scope review.DiffMode `json:"scope"`
FileVersion string `json:"fileVersion"`
Target string `json:"target,omitempty"`
Side string `json:"side"`
Start int `json:"start"`
End int `json:"end"`
Body string `json:"body"`
}
type DeletedComments ¶
type DeletedComments struct {
Comments []review.ReviewComment `json:"comments"`
Deleted int `json:"deleted"`
}
type ExportCommentsInput ¶
type MutationStore ¶
type MutationStore interface {
CommentStore
DeleteComment(context.Context, string, string) (bool, error)
DeleteComments(context.Context, string, map[string]bool) (int, error)
ImportComments(context.Context, string, []review.ReviewComment) ([]review.ReviewComment, error)
Marks(context.Context, string, review.DiffMode) ([]review.ReviewMark, error)
ClearMarks(context.Context, string, review.DiffMode) error
DeleteMark(context.Context, string, review.DiffMode, string) error
PutMark(context.Context, string, review.ReviewMark) error
StoredVersion(context.Context, string, string, string, time.Time) (review.RepositoryDiff, error)
ObservationFileVersion(context.Context, string, string, review.DiffMode, string) (reviewdata.FileVersion, error)
ObservationPatch(context.Context, string, string, review.DiffMode, string, string) (review.FilePatch, error)
CommitStore
}
type Resolution ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(active reviewsession.Session, store MutationStore) *Service
func (*Service) CarryComment ¶ added in v0.2.1
func (service *Service) CarryComment(ctx context.Context, commentID string) (review.ReviewComment, error)
CarryComment keeps an open comment whose code changed or is no longer changed as a file comment on this context's snapshot. It preserves the original code and selection.
func (*Service) ClearMarks ¶
func (*Service) CommitContents ¶ added in v0.2.2
func (*Service) CommitPatch ¶ added in v0.2.2
func (service *Service) CommitPatch(ctx context.Context, oid, fileID, fileVersion string) (review.FilePatch, error)
CommitPatch validates the file reference before reading its stored preview.
func (*Service) CommitSnapshot ¶ added in v0.2.2
func (service *Service) CommitSnapshot(ctx context.Context, oid string) (review.RepositoryDiff, error)
CommitSnapshot reads a captured commit's diff against its first parent.
func (*Service) Commits ¶ added in v0.2.2
func (service *Service) Commits(ctx context.Context) (CommitList, error)
func (*Service) CreateComment ¶
func (service *Service) CreateComment(ctx context.Context, body CreateCommentInput) (review.ReviewComment, error)
func (*Service) CurrentContents ¶ added in v0.2.1
func (*Service) CurrentFile ¶
func (*Service) CurrentPatch ¶ added in v0.2.1
func (service *Service) CurrentPatch(ctx context.Context, mode review.DiffMode, diffID, versionID, fileID, fileVersion string) (review.FilePatch, error)
CurrentPatch validates the caller's immutable scope and file references before reading the preview. Scope conflicts take precedence over missing file errors.
func (*Service) DeleteComment ¶
func (*Service) DeleteComments ¶
func (*Service) DeleteMark ¶
func (*Service) ExportComments ¶
func (*Service) ImportComments ¶
func (service *Service) ImportComments(ctx context.Context, input []review.ReviewComment) ([]review.ReviewComment, error)
func (*Service) ListComments ¶
ListComments returns the stream's comments placed in this context. Only open comments that render on current lines are actionable.
func (*Service) OwnsDiff ¶ added in v0.2.1
OwnsDiff reports whether a diff identity belongs to this context.
func (*Service) Patch ¶ added in v0.2.1
func (service *Service) Patch(ctx context.Context, mode review.DiffMode, fileID string) (review.FilePatch, error)
Patch reads a stored file preview without materializing the scope manifest.
func (*Service) ResolveComment ¶
func (*Service) Session ¶ added in v0.2.1
func (service *Service) Session() reviewsession.Session
Session is the resolved context the service is bound to.
func (*Service) Snapshot ¶
func (service *Service) Snapshot(ctx context.Context, mode review.DiffMode) (review.RepositoryDiff, error)
Snapshot reads and capability checks belong to the application, shared by transports.
func (*Service) UpdateComment ¶
func (service *Service) UpdateComment(ctx context.Context, commentID string, body UpdateCommentInput) (review.ReviewComment, error)