Documentation ¶
Index ¶
- func Sort(getter moduleGetter) func(*Workspace, *Workspace) int
- type ListOptions
- type Service
- func (s *Service) Create(path, name string) (*Workspace, *task.Task, error)
- func (s *Service) Delete(id resource.ID) (*task.Task, error)
- func (s *Service) Get(workspaceID resource.ID) (*Workspace, error)
- func (s *Service) GetByName(moduleID resource.ID, name string) (*Workspace, error)
- func (s *Service) List(opts ListOptions) []*Workspace
- func (s *Service) LoadWorkspacesUponModuleLoad(ms moduleSubscription)
- func (s *Service) Reload(moduleID resource.ID) (*task.Task, error)
- func (s *Service) SelectWorkspace(moduleID, workspaceID resource.ID) error
- func (s *Service) SetCurrentRun(workspaceID, runID resource.ID) error
- type ServiceOptions
- type Workspace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ListOptions ¶
type Service ¶
func NewService ¶
func NewService(opts ServiceOptions) *Service
func (*Service) List ¶
func (s *Service) List(opts ListOptions) []*Workspace
func (*Service) LoadWorkspacesUponModuleLoad ¶
func (s *Service) LoadWorkspacesUponModuleLoad(ms moduleSubscription)
LoadWorkspacesUponModuleLoad automatically loads workspaces for a module whenever: * a new module is loaded into pug for the first time, unless it is yet to be initialized (because `terraform workspace list` would fail) * an existing module is updated, has been initialized, and does not yet have a current workspace.
func (*Service) Reload ¶
Reload invokes `terraform workspace list` on a module and updates pug with the results, adding any newly discovered workspaces and pruning any workspaces no longer found to exist.
func (*Service) SelectWorkspace ¶
SelectWorkspace runs the `terraform workspace select <workspace_name>` command, which sets the current workspace for the module. Once that's finished it then updates the current workspace in pug itself too.