Skip to main content
Templates let you pre-build sandbox images with specific packages, files, and environment variables installed. Once built, a template can be referenced by alias in Create(WithTemplate("my-template")) to boot sandboxes that start from a known state.

TemplateSpec

TemplateSpec defines how to build a sandbox template.

CopyItem


declaw.BuildTemplate()

Build a new template and wait for the build to complete.
Returns (*BuildInfo, error)

declaw.BuildTemplateBackground()

Start a template build and return immediately without waiting for completion.
Returns (*BuildInfo, error)

declaw.GetBuildStatus()

Poll the status of a background build.
Returns (*BuildInfo, error)

declaw.ListTemplates()

List all templates owned by the caller.
Returns ([]TemplateInfo, error)

declaw.GetTemplate()

Get information about a specific template.
Returns (*TemplateInfo, error)

declaw.DeleteTemplate()

Delete a template by its ID.
Returns error

Data models

BuildInfo

TemplateInfo


Using a template in Create()

Once a template is built, reference it by alias:

Polling a background build