Documentation
¶
Index ¶
- func RunGitCommand(ctx context.Context, dir string, args ...string) (out string, rerr error)
- func RunInteractiveGitCommand(ctx context.Context, dir string, w io.Writer, args ...string) (rerr error)
- type Repository
- func (r *Repository) Apply(ctx context.Context, id string, w io.Writer) error
- func (r *Repository) Checkout(ctx context.Context, id, branch string) (string, error)
- func (r *Repository) Create(ctx context.Context, dag *dagger.Client, description, explanation string) (*environment.Environment, error)
- func (r *Repository) Delete(ctx context.Context, id string) error
- func (r *Repository) Diff(ctx context.Context, id string, w io.Writer) error
- func (r *Repository) Get(ctx context.Context, dag *dagger.Client, id string) (*environment.Environment, error)
- func (r *Repository) Info(ctx context.Context, id string) (*environment.EnvironmentInfo, error)
- func (r *Repository) IsDirty(ctx context.Context) (bool, string, error)
- func (r *Repository) List(ctx context.Context) ([]*environment.EnvironmentInfo, error)
- func (r *Repository) Log(ctx context.Context, id string, patch bool, w io.Writer) error
- func (r *Repository) Merge(ctx context.Context, id string, w io.Writer) error
- func (r *Repository) SourcePath() string
- func (r *Repository) Update(ctx context.Context, env *environment.Environment, explanation string) error
- func (r *Repository) WorktreePath(id string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunGitCommand ¶
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 OpenWithBasePath ¶
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 ¶
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) Get ¶
func (r *Repository) Get(ctx context.Context, dag *dagger.Client, id string) (*environment.Environment, error)
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 ¶
func (r *Repository) Info(ctx context.Context, id string) (*environment.EnvironmentInfo, error)
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 ¶
func (r *Repository) List(ctx context.Context) ([]*environment.EnvironmentInfo, error)
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) SourcePath ¶
func (r *Repository) SourcePath() string
func (*Repository) Update ¶
func (r *Repository) Update(ctx context.Context, env *environment.Environment, 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.
func (*Repository) WorktreePath ¶ added in v0.2.0
func (r *Repository) WorktreePath(id string) (string, error)