service

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module(c *di.Container)

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

func (s *Service) RecordActivity(ctx context.Context, workspaceID string) error

RecordActivity sends notifications and resurrects existing suggestions.

func (*Service) RemovePatches

func (s *Service) RemovePatches(ctx context.Context, suggestion *suggestions.Suggestion, patchIDs ...string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL