Documentation
¶
Index ¶
- Variables
- type Catalog
- 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 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) 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) 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 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)
}
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) 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)