Help us shape the future of Go! Take the 2026 Go Developer Survey

repocontext

package
v0.63.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package repocontext manages per-repository context directories.

Index

Constants

View Source
const CanvasesDirName = "canvases"

CanvasesDirName is the entry Hive Desktop keeps a repository's canvases in. Prune leaves it alone: a canvas is durable output, and the age of its directory says nothing about whether it is still wanted.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service manages per-repository context directories.

func NewService

func NewService(logger zerolog.Logger, cfg *config.Config, gitClient git.Git) *Service

NewService creates a new Service.

func (c *Service) CreateSymlink(ctxDir string) (bool, error)

CreateSymlink creates a symlink from the current directory to the context directory. Returns true if the symlink already existed and pointed to the correct target.

func (*Service) Init

func (c *Service) Init(ctxDir string) ([]string, error)

Init creates the context directory and standard subdirectories. Returns the list of subdirectories that were newly created.

func (*Service) Prune

func (c *Service) Prune(ctxDir string, olderThan time.Duration) (int, error)

Prune deletes files in the context directory older than the given duration. Returns the number of files removed.

func (*Service) ResolveDir

func (c *Service) ResolveDir(ctx context.Context, repo string, shared bool) (string, error)

ResolveDir determines the context directory for the given repo spec. If repo is "owner/repo", it resolves directly. If shared is true, returns the shared dir. Otherwise detects from the current directory's git remote.

Jump to

Keyboard shortcuts

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