snapshotter

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCantSnapshotRebasing    = errors.New("can't snapshot, rebasing in progress")
	ErrCantSnapshotWrongBranch = errors.New("can't snapshot, unexpected branch")
)

Functions

func Module

func Module(c *di.Container)

Types

type CopyOption

type CopyOption func(*CopyOptions)

func CopyWithPatchIDs

func CopyWithPatchIDs(patchIDs []string) CopyOption

type CopyOptions

type CopyOptions struct {
	PatchIDs *[]string
}

type DiffsOption

type DiffsOption func(*DiffsOptions)

func DiffWithPatchIDs

func DiffWithPatchIDs(patchIDs []string) DiffsOption

func WithAllower

func WithAllower(allower *unidiff.Allower) DiffsOption

type DiffsOptions

type DiffsOptions struct {
	Allower  *unidiff.Allower
	PatchIDs *[]string
}

type SnapshotOption

type SnapshotOption func(*SnapshotOptions)

func WithMarkAsLatestInWorkspace

func WithMarkAsLatestInWorkspace() SnapshotOption

func WithOnExistingCommit

func WithOnExistingCommit(commit string) SnapshotOption

func WithOnRepo

func WithOnRepo(repo vcs.RepoReaderGitWriter) SnapshotOption

func WithOnTrunk

func WithOnTrunk() SnapshotOption

func WithOnView

func WithOnView(viewID string) SnapshotOption

func WithPatchIDsFilter

func WithPatchIDsFilter(patchIDs []string) SnapshotOption

func WithPaths

func WithPaths(paths []string) SnapshotOption

func WithRevertCommitID

func WithRevertCommitID(commitID string) SnapshotOption

type SnapshotOptions

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

type Snapshotter

type Snapshotter interface {
	Snapshot(codebaseID, workspaceID string, action snapshots.Action, options ...SnapshotOption) (*snapshots.Snapshot, error)
	Copy(ctx context.Context, snapshotID string, oo ...CopyOption) (*snapshots.Snapshot, error)
	Diffs(ctx context.Context, snapshotID string, oo ...DiffsOption) ([]unidiff.FileDiff, error)
	GetByID(context.Context, string) (*snapshots.Snapshot, error)
}

todo: rename to snapshot service

func NewGitSnapshotter

func NewGitSnapshotter(
	snapshotsRepo db_snapshots.Repository,
	workspaceReader db_workspace.WorkspaceReader,
	workspaceWriter db_workspace.WorkspaceWriter,
	viewRepo db_view.Repository,
	eventSender events.EventSender,
	executorProvider executor.Provider,
	logger *zap.Logger,
) Snapshotter

Jump to

Keyboard shortcuts

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