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) ClearMarks(mode review.DiffMode) error
- func (service *Service) Comments() ([]review.ReviewComment, error)
- func (service *Service) CreateComment(ctx context.Context, body CreateCommentInput) (review.ReviewComment, error)
- func (service *Service) CurrentFile(ctx context.Context, mode review.DiffMode, ...) (review.RepositoryDiff, review.ChangedFile, error)
- func (service *Service) DeleteComment(id string) (bool, error)
- func (service *Service) DeleteComments(ctx context.Context, selection string) (DeletedComments, error)
- func (service *Service) DeleteMark(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(mode review.DiffMode) ([]review.ReviewMark, error)
- func (service *Service) PutMark(ctx context.Context, mode review.DiffMode, ...) (review.ReviewMark, error)
- func (service *Service) ResolveComment(commentID string) (Resolution, error)
- func (service *Service) Snapshot(ctx context.Context, mode review.DiffMode) (review.RepositoryDiff, error)
- func (service *Service) UpdateComment(commentID string, body UpdateCommentInput) (review.ReviewComment, error)
- type UpdateCommentInput
Constants ¶
This section is empty.
Variables ¶
View Source
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 string `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 CommentStore interface {
Comments(string) ([]review.ReviewComment, error)
PutComment(string, review.ReviewComment) error
}
type ContextProvider ¶
type ContextProvider interface {
ListFiltered(context.Context, int, string, ingestion.Filter) (contextservice.Page, error)
Resolve(context.Context, string) (session.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(string, string) (bool, error)
DeleteComments(string, map[string]bool) (int, error)
ImportComments(string, []review.ReviewComment) ([]review.ReviewComment, error)
Marks(string, review.DiffMode) ([]review.ReviewMark, error)
ClearMarks(string, review.DiffMode) error
DeleteMark(string, review.DiffMode, string) error
PutMark(string, review.ReviewMark) error
StoredVersion(string, string, string, time.Time) (review.RepositoryDiff, error)
}
type Resolution ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) CreateComment ¶
func (service *Service) CreateComment(ctx context.Context, body CreateCommentInput) (review.ReviewComment, error)
func (*Service) CurrentFile ¶
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 ¶
func (*Service) ResolveComment ¶
func (service *Service) ResolveComment(commentID string) (Resolution, error)
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(commentID string, body UpdateCommentInput) (review.ReviewComment, error)
type UpdateCommentInput ¶
Click to show internal directories.
Click to hide internal directories.