Documentation
¶
Overview ¶
Package sidecar coordinates skeeper's mirrored Git repository.
Index ¶
- Constants
- func DefaultNamespace(repoName string) string
- func UpdateGitignore(root string, namespaces []config.Namespace) error
- type HydrateResult
- type InitDefaults
- type InitOptions
- type InitResult
- type NamespaceStatus
- type NamespaceSyncResult
- type Service
- func (s *Service) Hydrate(ctx context.Context, dir string) (HydrateResult, error)
- func (s *Service) Init(ctx context.Context, dir string, opts InitOptions) (InitResult, error)
- func (s *Service) InitDefaults(ctx context.Context, dir string) (InitDefaults, error)
- func (s *Service) Log(ctx context.Context, dir, path string) (string, error)
- func (s *Service) Status(ctx context.Context, dir string) (Status, error)
- func (s *Service) Sync(ctx context.Context, dir string, opts SyncOptions) (SyncResult, error)
- type Status
- type SyncOptions
- type SyncResult
Constants ¶
const (
// DirName is the sidecar clone directory in the main worktree.
DirName = ".skeeper"
)
Variables ¶
This section is empty.
Functions ¶
func DefaultNamespace ¶ added in v0.1.1
DefaultNamespace returns a safe sidecar namespace derived from a repo name.
Types ¶
type HydrateResult ¶
HydrateResult reports files restored by hydrate.
type InitDefaults ¶
type InitDefaults struct {
SidecarName string
Visibility string
Namespace string
Patterns []string
}
InitDefaults reports the values init should present before user overrides.
type InitOptions ¶
type InitOptions struct {
Sidecar string
SidecarName string
Visibility string
Namespace string
NamespaceSet 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 NamespaceStatus ¶ added in v0.1.1
type NamespaceStatus struct {
Name string
Branch string
LastCommit string
LastUnix int64
Remote string
TrackedFiles int
}
NamespaceStatus describes one namespace's sidecar state.
type NamespaceSyncResult ¶ added in v0.1.1
type NamespaceSyncResult struct {
Name string
Branch string
ChangedFiles int
Committed bool
Commit string
}
NamespaceSyncResult reports one namespace sync outcome.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service executes sidecar workflows.
func (*Service) Hydrate ¶
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 ¶
InitDefaults returns deterministic defaults for the project at dir.
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
Namespaces []NamespaceStatus
PendingSync int
}
Status describes the current sidecar state.
type SyncOptions ¶
SyncOptions configures a sync run.
type SyncResult ¶
type SyncResult struct {
ChangedFiles int
Committed bool
Commit string
Namespaces []NamespaceSyncResult
Queued bool
QueueFailed bool
QueueError string
}
SyncResult reports a completed sync.