Documentation
¶
Index ¶
- Variables
- type ConflictError
- type CreateRequest
- type PushRequest
- type PushResult
- type ValidationError
- type WorkspaceService
- func (s *WorkspaceService) Create(ctx context.Context, req CreateRequest, userID uuid.UUID) (*models.Workspace, error)
- func (s *WorkspaceService) Delete(ctx context.Context, wsID string, userID uuid.UUID) error
- func (s *WorkspaceService) Get(id string) (*models.Workspace, error)
- func (s *WorkspaceService) GetPixiToml(wsID string) (string, error)
- func (s *WorkspaceService) GetVersion(wsID string, versionNum string) (*models.WorkspaceVersion, error)
- func (s *WorkspaceService) GetVersionFile(wsID string, versionNum string, field string) (string, error)
- func (s *WorkspaceService) List(userID uuid.UUID) ([]models.Workspace, error)
- func (s *WorkspaceService) ListTags(wsID string) ([]models.WorkspaceTag, error)
- func (s *WorkspaceService) ListVersions(wsID string) ([]models.WorkspaceVersion, error)
- func (s *WorkspaceService) PushVersion(ctx context.Context, wsID string, req PushRequest, userID uuid.UUID) (*PushResult, error)
- func (s *WorkspaceService) SavePixiToml(wsID string, content string) error
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not found")
ErrNotFound indicates the requested resource was not found.
Functions ¶
This section is empty.
Types ¶
type ConflictError ¶
type ConflictError struct {
Message string
}
ConflictError represents a conflict condition (HTTP 409).
func (*ConflictError) Error ¶
func (e *ConflictError) Error() string
type CreateRequest ¶
type CreateRequest struct {
Name string
PackageManager string
PixiToml string
Source string
Path string
}
CreateRequest holds parameters for creating a workspace.
type PushRequest ¶
PushRequest holds parameters for pushing a new version.
type PushResult ¶
type PushResult struct {
VersionNumber int
Tags []string
ContentHash string
Deduplicated bool
Tag string // kept for backwards compatibility
}
PushResult is returned after a successful push.
type ValidationError ¶
type ValidationError struct {
Message string
}
ValidationError represents a bad-request condition (HTTP 400).
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
type WorkspaceService ¶
type WorkspaceService struct {
// contains filtered or unexported fields
}
WorkspaceService contains the business logic for workspace operations.
func (*WorkspaceService) Create ¶
func (s *WorkspaceService) Create(ctx context.Context, req CreateRequest, userID uuid.UUID) (*models.Workspace, error)
Create validates and creates a new workspace, queues the creation job, grants RBAC owner access, and writes an audit log entry.
func (*WorkspaceService) Delete ¶
Delete queues a deletion job for the workspace and writes an audit log.
func (*WorkspaceService) Get ¶
func (s *WorkspaceService) Get(id string) (*models.Workspace, error)
Get returns a single workspace by ID.
func (*WorkspaceService) GetPixiToml ¶
func (s *WorkspaceService) GetPixiToml(wsID string) (string, error)
GetPixiToml reads the pixi.toml content from the workspace's filesystem.
func (*WorkspaceService) GetVersion ¶
func (s *WorkspaceService) GetVersion(wsID string, versionNum string) (*models.WorkspaceVersion, error)
GetVersion returns a specific version by workspace ID and version number.
func (*WorkspaceService) GetVersionFile ¶
func (s *WorkspaceService) GetVersionFile(wsID string, versionNum string, field string) (string, error)
GetVersionFile returns the content of a specific file field from a version. field must be "lock" or "manifest".
func (*WorkspaceService) List ¶
List returns workspaces visible to the given user. In local mode all workspaces are returned (no ownership filtering).
func (*WorkspaceService) ListTags ¶
func (s *WorkspaceService) ListTags(wsID string) ([]models.WorkspaceTag, error)
ListTags returns tags for a workspace, ordered by creation time descending.
func (*WorkspaceService) ListVersions ¶
func (s *WorkspaceService) ListVersions(wsID string) ([]models.WorkspaceVersion, error)
ListVersions returns versions for a workspace (excluding large file contents).
func (*WorkspaceService) PushVersion ¶
func (s *WorkspaceService) PushVersion(ctx context.Context, wsID string, req PushRequest, userID uuid.UUID) (*PushResult, error)
PushVersion creates a new workspace version (or deduplicates), writes files, handles tags (content hash, latest, optional user tag), and records audit logs.
func (*WorkspaceService) SavePixiToml ¶
func (s *WorkspaceService) SavePixiToml(wsID string, content string) error
SavePixiToml writes pixi.toml content to the workspace's filesystem.