Documentation ¶
Index ¶
- func Module(c *di.Container)
- type Service
- func (s *Service) ApplyHunks(ctx context.Context, suggestion *suggestions.Suggestion, hunkIDs ...string) error
- func (s *Service) Create(ctx context.Context, userID string, forWorkspace *workspace.Workspace) (*suggestions.Suggestion, error)
- func (s *Service) Diffs(ctx context.Context, suggestion *suggestions.Suggestion, oo ...unidiff.Option) ([]unidiff.FileDiff, error)
- func (s *Service) Dismiss(ctx context.Context, suggestion *suggestions.Suggestion) error
- func (s *Service) DismissHunks(ctx context.Context, suggestion *suggestions.Suggestion, hunkIDs ...string) error
- func (s *Service) GetByID(ctx context.Context, id suggestions.ID) (*suggestions.Suggestion, error)
- func (s *Service) GetByWorkspaceID(ctx context.Context, workspaceID string) (*suggestions.Suggestion, error)
- func (s *Service) ListBySnapshotID(ctx context.Context, snapshotID string) ([]*suggestions.Suggestion, error)
- func (s *Service) ListForWorkspaceID(ctx context.Context, forWorkspaceID string) ([]*suggestions.Suggestion, error)
- func (s *Service) RecordActivity(ctx context.Context, workspaceID string) error
- func (s *Service) RemovePatches(ctx context.Context, suggestion *suggestions.Suggestion, patchIDs ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New( logger *zap.Logger, suggestionRepo db_suggestions.Repository, workspaceService service_workspace.Service, executorProvider executor.Provider, snapshotter snapshotter.Snapshotter, analyticsClient analytics.Client, notificationSender sender_notification.NotificationSender, eventSender events.EventSender, ) *Service
func (*Service) ApplyHunks ¶
func (s *Service) ApplyHunks(ctx context.Context, suggestion *suggestions.Suggestion, hunkIDs ...string) error
ApplyHunks applies the suggested hunks to the workspace.
func (*Service) Create ¶
func (s *Service) Create(ctx context.Context, userID string, forWorkspace *workspace.Workspace) (*suggestions.Suggestion, error)
func (*Service) Diffs ¶
func (s *Service) Diffs(ctx context.Context, suggestion *suggestions.Suggestion, oo ...unidiff.Option) ([]unidiff.FileDiff, error)
Diffs returns all the diffs of the suggestion as viewed by the suggestion.ForWorkspace.
func (*Service) Dismiss ¶
func (s *Service) Dismiss(ctx context.Context, suggestion *suggestions.Suggestion) error
Dismiss marks the suggestion as dismissed.
func (*Service) DismissHunks ¶
func (s *Service) DismissHunks(ctx context.Context, suggestion *suggestions.Suggestion, hunkIDs ...string) error
DismissHunks marks suggeted hunks as dismissed.
func (*Service) GetByID ¶
func (s *Service) GetByID(ctx context.Context, id suggestions.ID) (*suggestions.Suggestion, error)
GetByID returns a suggestion by id.
func (*Service) GetByWorkspaceID ¶
func (s *Service) GetByWorkspaceID(ctx context.Context, workspaceID string) (*suggestions.Suggestion, error)
GetByWorkspaceID returns a suggestion that is made from the workspaceID.
func (*Service) ListBySnapshotID ¶
func (s *Service) ListBySnapshotID(ctx context.Context, snapshotID string) ([]*suggestions.Suggestion, error)
func (*Service) ListForWorkspaceID ¶
func (s *Service) ListForWorkspaceID(ctx context.Context, forWorkspaceID string) ([]*suggestions.Suggestion, error)
ListForWorkspaceID return a list of currently opened suggestions for the workspace.
func (*Service) RecordActivity ¶
RecordActivity sends notifications and resurrects existing suggestions.
func (*Service) RemovePatches ¶
func (s *Service) RemovePatches(ctx context.Context, suggestion *suggestions.Suggestion, patchIDs ...string) error
Click to show internal directories.
Click to hide internal directories.