repository

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunGitCommand

func RunGitCommand(ctx context.Context, dir string, args ...string) (out string, rerr error)

RunGitCommand executes a git command in the specified directory. This is exported for use in tests and other packages that need direct git access.

Types

type Repository

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

func Open

func Open(ctx context.Context, repo string) (*Repository, error)

func OpenWithBasePath

func OpenWithBasePath(ctx context.Context, repo string, basePath string) (*Repository, error)

OpenWithBasePath opens a repository with a custom base path for container-use data. This is useful for tests that need isolated environments.

func (*Repository) Checkout

func (r *Repository) Checkout(ctx context.Context, id, branch string) (string, error)

Checkout changes the user's current branch to that of the identified environment. It attempts to get the most recent commit from the environment without discarding any user changes.

func (*Repository) Create

func (r *Repository) Create(ctx context.Context, dag *dagger.Client, description, explanation string) (*environment.Environment, error)

Create creates a new environment with the given description and explanation. Requires a dagger client for container operations during environment initialization.

func (*Repository) Delete

func (r *Repository) Delete(ctx context.Context, id string) error

Delete removes an environment from the repository.

func (*Repository) Diff added in v0.1.1

func (r *Repository) Diff(ctx context.Context, id string, w io.Writer) error

func (*Repository) Get

Get retrieves a full Environment with dagger client embedded for container operations. Use this when you need to perform container operations like running commands, terminals, etc. For basic metadata access without container operations, use Info() instead.

func (*Repository) Info

Info retrieves environment metadata without requiring dagger operations. This is more efficient than Get() when you only need access to configuration, state, and other metadata without performing container operations.

func (*Repository) List

List returns information about all environments in the repository. Returns EnvironmentInfo slice avoiding dagger client initialization. Use Get() on individual environments when you need full Environment with container operations.

func (*Repository) Log added in v0.1.1

func (r *Repository) Log(ctx context.Context, id string, patch bool, w io.Writer) error

func (*Repository) SourcePath

func (r *Repository) SourcePath() string

func (*Repository) Update

func (r *Repository) Update(ctx context.Context, env *environment.Environment, operation, explanation string) error

Update saves the provided environment to the repository. Writes configuration and source code changes to the worktree and history + state to git notes.

Jump to

Keyboard shortcuts

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