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.
(ctx context.Context, id string)
| 268 | // This is more efficient than Get() when you only need access to configuration, |
| 269 | // state, and other metadata without performing container operations. |
| 270 | func (r *Repository) Info(ctx context.Context, id string) (*environment.EnvironmentInfo, error) { |
| 271 | if err := r.exists(ctx, id); err != nil { |
| 272 | return nil, err |
| 273 | } |
| 274 | |
| 275 | worktree, err := r.getWorktree(ctx, id) |
| 276 | if err != nil { |
| 277 | return nil, err |
| 278 | } |
| 279 | |
| 280 | state, err := r.loadState(ctx, worktree) |
| 281 | if err != nil { |
| 282 | return nil, err |
| 283 | } |
| 284 | |
| 285 | envInfo, err := environment.LoadInfo(ctx, id, state, worktree) |
| 286 | if err != nil { |
| 287 | return nil, err |
| 288 | } |
| 289 | |
| 290 | return envInfo, nil |
| 291 | } |
| 292 | |
| 293 | // List returns information about all environments in the repository. |
| 294 | // Returns EnvironmentInfo slice avoiding dagger client initialization. |
no test coverage detected