Documentation ¶
Index ¶
- type DriftDetection
- type UpdateWorkspaceParams
- type Workspace
- type WorkspaceLock
- type WorkspaceVcsConnection
- type WorkspacesRepository
- type WorkspacesRepositoryImpl
- func (w WorkspacesRepositoryImpl) Delete(workspaceId string) error
- func (w WorkspacesRepositoryImpl) FindAll() ([]Workspace, error)
- func (w WorkspacesRepositoryImpl) FindAllForOrg(organizationId uuid.UUID) ([]Workspace, error)
- func (w WorkspacesRepositoryImpl) FindById(organizationId uuid.UUID, workspaceId string) (*Workspace, error)
- func (w WorkspacesRepositoryImpl) Lock(workspace *Workspace) error
- func (w WorkspacesRepositoryImpl) Save(workspace *Workspace) error
- func (w WorkspacesRepositoryImpl) Unlock(workspace *Workspace) error
- func (w WorkspacesRepositoryImpl) Update(workspace *Workspace) (*Workspace, error)
- type WorkspacesService
- type WorkspacesServiceImpl
- func (s WorkspacesServiceImpl) Create(workspace *Workspace) error
- func (s WorkspacesServiceImpl) Delete(workspaceId string) error
- func (s WorkspacesServiceImpl) FindAll() ([]Workspace, error)
- func (s WorkspacesServiceImpl) FindById(workspaceId string) (*Workspace, error)
- func (s WorkspacesServiceImpl) Update(workspace *Workspace) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DriftDetection ¶
type UpdateWorkspaceParams ¶
type Workspace ¶
type Workspace struct { ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid()" json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt *time.Time `sql:"index" json:"deleted_at"` // Name of the workspace Name string `gorm:"index:idx_name,unique" json:"name"` // Does the workspace allow destroy plans AllowDestroy bool `json:"allow_destroy"` // Does the workspace auto apply planned runs AutoApply bool `json:"auto_apply"` // Schedule the workspace for auto destruction AutoDestroyAt *time.Time `json:"auto_destroy_at" sql:"index"` // How our applies executed? Possible values are // - apply_on_pull_request // - apply_on_merge ExecutionMode string `json:"execution_mode"` // Configuration for the VCS containing the IaC Vcs WorkspaceVcsConnection `gorm:"embedded;embeddedPrefix:vcs_" json:"vcs"` // The opentofu version for the workspace // Can be set to 'latest' to always pull the latest available version Version string `json:"version"` // Is the workspace currently locked Locked bool `json:"locked"` // Lock configuration // TODO: Just move this to top level fields, no need // to embed this as a separate object Lock WorkspaceLock `gorm:"embedded;embeddedPrefix:lock_" json:"lock,omitempty"` // ID of the owning organization OrganizationID uuid.UUID `gorm:"index:idx_name,unique" json:"organization_id"` Organization organization.Organization `json:"-"` // Agent configuration AgentID *uuid.UUID `json:"-"` Agent agent.Agent `json:"agent,omitempty"` // DriftDetection DriftDetection DriftDetection `gorm:"embedded;embeddedPrefix:drift_detection_" json:"drift_detection"` }
type WorkspaceLock ¶
type WorkspaceVcsConnection ¶
type WorkspaceVcsConnection struct { // The Git URL for the workspace Source string `json:"source"` // Which branch we're applying / watching for PRs to Branch string `json:"branch"` // Patterns to match for executing Patterns []string `json:"patterns" gorm:"serializer:json"` // Prefixes to match for executing Prefixes []string `json:"prefixes" gorm:"serializer:json"` // Specify the working directory WorkingDirectory string `json:"working_directory"` }
type WorkspacesRepository ¶
type WorkspacesRepository interface { Save(workspace *Workspace) error Update(workspace *Workspace) (*Workspace, error) Lock(workspace *Workspace) error Unlock(workspace *Workspace) error Delete(workspaceId string) error FindById(organizationId uuid.UUID, workspaceId string) (*Workspace, error) FindAll() ([]Workspace, error) FindAllForOrg(organizationId uuid.UUID) ([]Workspace, error) }
func NewWorkspacesRepository ¶
func NewWorkspacesRepository(db *gorm.DB) WorkspacesRepository
type WorkspacesRepositoryImpl ¶
func (WorkspacesRepositoryImpl) Delete ¶
func (w WorkspacesRepositoryImpl) Delete(workspaceId string) error
func (WorkspacesRepositoryImpl) FindAll ¶
func (w WorkspacesRepositoryImpl) FindAll() ([]Workspace, error)
func (WorkspacesRepositoryImpl) FindAllForOrg ¶
func (w WorkspacesRepositoryImpl) FindAllForOrg(organizationId uuid.UUID) ([]Workspace, error)
func (WorkspacesRepositoryImpl) Lock ¶
func (w WorkspacesRepositoryImpl) Lock(workspace *Workspace) error
func (WorkspacesRepositoryImpl) Save ¶
func (w WorkspacesRepositoryImpl) Save(workspace *Workspace) error
func (WorkspacesRepositoryImpl) Unlock ¶
func (w WorkspacesRepositoryImpl) Unlock(workspace *Workspace) error
type WorkspacesService ¶
type WorkspacesService interface { Create(workspace *Workspace) error Update(workspace *Workspace) error Delete(workspaceId string) error FindById(workspaceId string) (*Workspace, error) FindAll() ([]Workspace, error) }
func NewWorkspacesServiceImpl ¶
func NewWorkspacesServiceImpl(repository WorkspacesRepository, validate *validator.Validate) WorkspacesService
type WorkspacesServiceImpl ¶
type WorkspacesServiceImpl struct { Repository WorkspacesRepository Validate *validator.Validate }
func (WorkspacesServiceImpl) Create ¶
func (s WorkspacesServiceImpl) Create(workspace *Workspace) error
func (WorkspacesServiceImpl) Delete ¶
func (s WorkspacesServiceImpl) Delete(workspaceId string) error
func (WorkspacesServiceImpl) FindAll ¶
func (s WorkspacesServiceImpl) FindAll() ([]Workspace, error)
func (WorkspacesServiceImpl) FindById ¶
func (s WorkspacesServiceImpl) FindById(workspaceId string) (*Workspace, error)
func (WorkspacesServiceImpl) Update ¶
func (s WorkspacesServiceImpl) Update(workspace *Workspace) error
Click to show internal directories.
Click to hide internal directories.