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: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureCodebaseStatus

func EnsureCodebaseStatus(repo vcs.RepoGitWriter) error

Types

type CopyPatchesOption

type CopyPatchesOption func(*CopyPatchesOptions)

func WithPatchIDs

func WithPatchIDs(patchIDs []string) CopyPatchesOption

type CopyPatchesOptions

type CopyPatchesOptions struct {
	PatchIDs *[]string
}

type CreateWorkspaceRequest

type CreateWorkspaceRequest struct {
	UserID           string
	CodebaseID       string
	Name             string
	RevertChangeID   string
	ChangeID         string
	DraftDescription string
}

type DiffsOption

type DiffsOption func(*DiffsOptions)

func WithAllower

func WithAllower(allower *unidiff.Allower) DiffsOption

func WithVCSDiffOptions

func WithVCSDiffOptions(options ...vcs.DiffOption) DiffsOption

type DiffsOptions

type DiffsOptions struct {
	Allower        *unidiff.Allower
	VCSDiffOptions []vcs.DiffOption
}

type Service

type Service interface {
	Create(CreateWorkspaceRequest) (*workspace.Workspace, error)
	GetByID(context.Context, string) (*workspace.Workspace, error)
	LandChange(ctx context.Context, ws *workspace.Workspace, patchIDs []string, diffOptions ...vcs.DiffOption) (*change.Change, error)
	CreateWelcomeWorkspace(codebaseID, userID, codebaseName string) error
	Diffs(context.Context, string, ...DiffsOption) ([]unidiff.FileDiff, bool, error)
	CopyPatches(ctx context.Context, src, dist *workspace.Workspace, opts ...CopyPatchesOption) error
	RemovePatches(context.Context, *unidiff.Allower, *workspace.Workspace, ...string) error
	HasConflicts(context.Context, *workspace.Workspace) (bool, error)
}

type WorkspaceService

type WorkspaceService struct {
	// contains filtered or unexported fields
}

func New

func New(
	logger *zap.Logger,
	analyticsClient analytics.Client,

	workspaceWriter db.WorkspaceWriter,
	workspaceReader db.WorkspaceReader,

	userRepo user_db.Repository,
	reviewRepo db_review.ReviewRepository,

	commentsService *service_comments.Service,
	changeService *service_change.Service,

	activitySender sender.ActivitySender,
	executorProvider executor.Provider,
	eventsSender events.EventSender,
	snapshotterQueue worker_snapshots.Queue,
	snap snapshotter.Snapshotter,
	buildQueue *workers_ci.BuildQueue,
) *WorkspaceService

func (*WorkspaceService) CopyPatches

func (s *WorkspaceService) CopyPatches(ctx context.Context, dist, src *workspace.Workspace, opts ...CopyPatchesOption) error

func (*WorkspaceService) Create

func (*WorkspaceService) CreateWelcomeWorkspace

func (svc *WorkspaceService) CreateWelcomeWorkspace(codebaseID, userID, codebaseName string) error

func (*WorkspaceService) Diffs

func (s *WorkspaceService) Diffs(ctx context.Context, workspaceID string, oo ...DiffsOption) ([]unidiff.FileDiff, bool, error)

func (*WorkspaceService) GetByID

func (*WorkspaceService) HasConflicts

func (s *WorkspaceService) HasConflicts(ctx context.Context, ws *workspace.Workspace) (bool, error)

func (*WorkspaceService) LandChange

func (s *WorkspaceService) LandChange(ctx context.Context, ws *workspace.Workspace, patchIDs []string, diffOpts ...vcs.DiffOption) (*change.Change, error)

func (*WorkspaceService) RemovePatches

func (s *WorkspaceService) RemovePatches(ctx context.Context, allower *unidiff.Allower, ws *workspace.Workspace, hunkIDs ...string) error

Jump to

Keyboard shortcuts

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