Documentation
¶
Index ¶
- Constants
- Variables
- func FakeSnapshotCooldownTime(t time.Duration) (restore func())
- type Manifest
- type WorkshopFileError
- type WorkshopManager
- func (w *WorkshopManager) Ensure() error
- func (w *WorkshopManager) Exec(ctx context.Context, name, projectId string, args *workshop.ExecArgs, ...) (*state.TaskSet, error)
- func (w *WorkshopManager) FormatRevision() sdk.Revision
- func (w *WorkshopManager) LaunchManifests(ctx context.Context, project workshop.Project, names []string) ([]Manifest, error)
- func (w *WorkshopManager) LaunchMany(ctx context.Context, project workshop.Project, manifests []Manifest) ([]*state.TaskSet, error)
- func (w *WorkshopManager) Project(ctx context.Context, pId string) (workshop.Project, error)
- func (w *WorkshopManager) RefreshManifests(ctx context.Context, project workshop.Project, names []string, ...) (current, latest []Manifest, err error)
- func (w *WorkshopManager) RefreshMany(ctx context.Context, project workshop.Project, current, latest []Manifest, ...) ([]*state.TaskSet, error)
- func (w *WorkshopManager) Remount(ctx context.Context, st *state.State, plug sdk.PlugRef, source string) (*state.TaskSet, error)
- func (w *WorkshopManager) RemoveManifests(ctx context.Context, projectId string, names []string) (stashed, current []Manifest, running map[string]bool, err error)
- func (w *WorkshopManager) RemoveMany(ctx context.Context, project workshop.Project, stashed, current []Manifest, ...) ([]*state.TaskSet, error)
- func (w *WorkshopManager) StartMany(ctx context.Context, names []string, projectId string) ([]*state.TaskSet, error)
- func (m *WorkshopManager) StartUp() error
- func (w *WorkshopManager) StopMany(ctx context.Context, names []string, projectId string) ([]*state.TaskSet, error)
- func (w *WorkshopManager) Workshop(ctx context.Context, name, pId string) (*workshop.Workshop, error)
- func (w *WorkshopManager) WorkshopFile(ctx context.Context, name, pId string) (*workshop.File, error)
- func (w *WorkshopManager) WorkshopFiles(ctx context.Context, pId string) (map[string]string, error)
- func (w *WorkshopManager) Workshops(ctx context.Context, pId string) ([]*workshop.Workshop, error)
Constants ¶
const ( // mark the last task in a taskset after which refresh becomes irreversible (i.e. the following tasks // will not be possible to undo, e.g. removing an old workshop copy) EdgeRefreshLastTaskBeforeCleanup = state.TaskSetEdge("last-before-irreversible") // mark the tasks that denote irreversible clean up logic for refresh (e.g. // removing state storage and the old workshop copy) EdgeRefreshFirstCleanupTask = state.TaskSetEdge("refresh-cleanup") )
Variables ¶
var StopLogInterval = 30 * time.Second
var StopWorkshop = (workshop.Backend).StopWorkshop
Functions ¶
Types ¶
type Manifest ¶
type Manifest struct {
File *workshop.File
Format sdk.Revision
Image workshop.BaseImage
Sdks []sdk.Setup
}
Manifest lists the components needed to construct a workshop. It augments the workshop definition with specific versions of the base image and SDKs.
type WorkshopFileError ¶
type WorkshopFileError struct {
// contains filtered or unexported fields
}
WorkshopFileError wraps errors related to invalid workshop definitions or file locations.
func (*WorkshopFileError) Error ¶
func (e *WorkshopFileError) Error() string
func (*WorkshopFileError) Unwrap ¶
func (e *WorkshopFileError) Unwrap() error
type WorkshopManager ¶
type WorkshopManager struct {
// contains filtered or unexported fields
}
func New ¶
func New(st *state.State, runner *state.TaskRunner) *WorkshopManager
func (*WorkshopManager) Ensure ¶
func (w *WorkshopManager) Ensure() error
func (*WorkshopManager) FormatRevision ¶ added in v0.9.3
func (w *WorkshopManager) FormatRevision() sdk.Revision
Returns the current snapshot format revision.
func (*WorkshopManager) LaunchManifests ¶
func (w *WorkshopManager) LaunchManifests(ctx context.Context, project workshop.Project, names []string) ([]Manifest, error)
LaunchManifests reads the definitions of the given workshops and resolves the latest base image and SDKs for each of them. This information is bundled into the resulting manifests.
func (*WorkshopManager) LaunchMany ¶
func (*WorkshopManager) RefreshManifests ¶
func (w *WorkshopManager) RefreshManifests(ctx context.Context, project workshop.Project, names []string, option conflict.RefreshOption) (current, latest []Manifest, err error)
RefreshManifests reconstructs the manifests that were used to create the given workshops. For --restore, these manifests are also used to refresh the workshops. Otherwise it resolves a new manifest similar to LaunchManifests.
func (*WorkshopManager) RefreshMany ¶
func (*WorkshopManager) RemoveManifests ¶
func (*WorkshopManager) RemoveMany ¶
func (*WorkshopManager) StartUp ¶
func (m *WorkshopManager) StartUp() error
func (*WorkshopManager) Workshop ¶
func (w *WorkshopManager) Workshop(ctx context.Context, name, pId string) (*workshop.Workshop, error)
Loads a workshop, the state must be locked as it is used to find out the workshop state
func (*WorkshopManager) WorkshopFile ¶
func (w *WorkshopManager) WorkshopFile(ctx context.Context, name, pId string) (*workshop.File, error)
Returns latest file for a workshop. The state must be locked, as listing projects can update project metadata.
func (*WorkshopManager) WorkshopFiles ¶
Returns all workshop files for a project. The state must be locked, as listing projects can update project metadata.