sidecar

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package sidecar coordinates skeeper's mirrored Git repository.

Index

Constants

View Source
const (
	// DirName is the sidecar clone directory in the main worktree.
	DirName = ".skeeper"
)

Variables

This section is empty.

Functions

func DefaultDirectory

func DefaultDirectory(repoName string) string

DefaultDirectory returns a safe sidecar namespace derived from a repo name.

func UpdateGitignore

func UpdateGitignore(root string, patterns []string) error

UpdateGitignore appends or replaces skeeper's managed ignore block.

Types

type HydrateResult

type HydrateResult struct {
	Restored []string
	Commit   string
}

HydrateResult reports files restored by hydrate.

type InitDefaults

type InitDefaults struct {
	SidecarName string
	Visibility  string
	Directory   string
	Patterns    []string
}

InitDefaults reports the values init should present before user overrides.

type InitOptions

type InitOptions struct {
	Sidecar      string
	SidecarName  string
	Visibility   string
	Directory    string
	DirectorySet bool
	NoDirectory  bool
	Bootstrap    string
	Patterns     []string
}

InitOptions configures project bootstrap.

type InitResult

type InitResult struct {
	Root      string
	Sidecar   string
	Config    config.Config
	HookPath  string
	Gitignore string
}

InitResult reports files changed by init.

type Service

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

Service executes sidecar workflows.

func New

func New(runner gitexec.Runner) *Service

New returns a sidecar service.

func (*Service) Hydrate

func (s *Service) Hydrate(ctx context.Context, dir string) (HydrateResult, error)

Hydrate clones the sidecar if needed and restores spec files to the main tree.

func (*Service) Init

func (s *Service) Init(ctx context.Context, dir string, opts InitOptions) (InitResult, error)

Init creates the remote sidecar, clones it, writes config, and installs hooks.

func (*Service) InitDefaults

func (s *Service) InitDefaults(ctx context.Context, dir string) (InitDefaults, error)

InitDefaults returns deterministic defaults for the project at dir.

func (*Service) Log

func (s *Service) Log(ctx context.Context, dir, path string) (string, error)

Log returns sidecar history for a mirrored file path.

func (*Service) Status

func (s *Service) Status(ctx context.Context, dir string) (Status, error)

Status returns a summary suitable for CLI display.

func (*Service) Sync

func (s *Service) Sync(ctx context.Context, dir string, opts SyncOptions) (SyncResult, error)

Sync mirrors main-tree spec files into the sidecar and pushes the branch.

type Status

type Status struct {
	Sidecar       string
	Branch        string
	Directory     string
	SidecarBranch string
	LastCommit    string
	LastUnix      int64
	Remote        string
	TrackedFiles  int
	PendingSync   int
}

Status describes the current sidecar state.

type SyncOptions

type SyncOptions struct {
	Pull bool
	Hook bool
}

SyncOptions configures a sync run.

type SyncResult

type SyncResult struct {
	ChangedFiles int
	Committed    bool
	Commit       string
	Queued       bool
	QueueFailed  bool
	QueueError   string
}

SyncResult reports a completed sync.

Jump to

Keyboard shortcuts

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