bootstrap

package
v2.16.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

This package defines the configuration file associated with LiveKit templates, which include instructions for package setup and development in both Playground mode and local dev.

Index

Constants

View Source
const (
	TaskFile                = "taskfile.yaml"
	TemplateIndexFile       = "templates.yaml"
	TemplateIndexURL        = "https://raw.githubusercontent.com/livekit-examples/index/main"
	TemplateBaseURL         = "https://github.com/livekit-examples"
	SandboxDashboardURL     = "https://cloud.livekit.io/projects/p_/sandbox"
	SandboxTemplateEndpoint = "/api/sandbox/template"
	SandboxCreateEndpoint   = "/api/sandbox/create"
)

Variables

This section is empty.

Functions

func CleanupTemplate

func CleanupTemplate(dir string) error

func CloneTemplate

func CloneTemplate(url, dir string) (string, string, error)

func CommandExists

func CommandExists(cmd string) bool

Determine if `cmd` is a binary in PATH or a known alias

func CommandIsAlias

func CommandIsAlias(cmd string) bool

Determine if `cmd` is a known alias

func CreateSandbox added in v2.6.1

func CreateSandbox(ctx context.Context, agentName, templateURL, token, serverURL string) (string, error)

func InstantiateDotEnv

func InstantiateDotEnv(ctx context.Context, rootDir string, exampleFilePath string, substitutions map[string]string, verbose bool, prompt PromptFunc) (map[string]string, error)

Read .env.example file if present in rootDir, replacing all `substitutions`, prompting for others, and returning the result as a map.

func NewTask

func NewTask(ctx context.Context, tf *ast.Taskfile, dir, taskName string, verbose bool) (func() error, error)

func NewTaskExecutor

func NewTaskExecutor(dir string, verbose bool) *task.Executor

func NewTaskWithExecutor added in v2.5.0

func NewTaskWithExecutor(ctx context.Context, exe *task.Executor, taskName string, verbose bool) (func() error, error)

func ParseTaskfile

func ParseTaskfile(rootPath string) (*ast.Taskfile, error)

func PrintDotEnv

func PrintDotEnv(envMap map[string]string) error

func ReadDotEnv added in v2.16.4

func ReadDotEnv(rootDir string, filePath string) (map[string]string, error)

ReadDotEnv reads filePath under rootDir as a dotenv file. Returns (nil, nil) if the file does not exist.

func WriteDotEnv

func WriteDotEnv(rootDir string, filePath string, envMap map[string]string, overwrite bool) error

WriteDotEnv writes envMap to filePath under rootDir. When overwrite is false and the file already exists, envMap is merged into the file in place: keys in envMap are updated (preserving any inline comments and the surrounding whitespace on those lines), keys not in envMap are preserved verbatim along with comments and blank lines, and any envMap keys not yet in the file are appended. When overwrite is true (or the file does not exist), the file is written fresh.

Types

type KnownTask

type KnownTask string
const (
	TaskPostCreate KnownTask = "post_create"
	TaskInstall    KnownTask = "install"
	TaskDev        KnownTask = "dev"
)

type PromptFunc

type PromptFunc func(key string, value string) (string, error)

type SandboxDetails

type SandboxDetails struct {
	Name           string     `json:"name"`
	Template       Template   `json:"template"`
	ChildTemplates []Template `json:"childTemplates"`
}

func FetchSandboxDetails

func FetchSandboxDetails(ctx context.Context, sid, token, serverURL string) (*SandboxDetails, error)

type Template

type Template struct {
	Name      string            `yaml:"name" json:"name"`
	Desc      string            `yaml:"desc" json:"description,omitempty"`
	URL       string            `yaml:"url" json:"url,omitempty"`
	Docs      string            `yaml:"docs" json:"docs_url,omitempty"`
	Image     string            `yaml:"image" json:"image_ref,omitempty"`
	Tags      []string          `yaml:"tags" json:"tags,omitempty"`
	Attrs     map[string]string `yaml:"attrs" json:"attrs,omitempty"`
	Requires  []string          `yaml:"requires" json:"requires,omitempty"`
	IsSandbox bool              `yaml:"is_sandbox" json:"is_sandbox,omitempty"`
	IsHidden  bool              `yaml:"is_hidden" json:"is_hidden,omitempty"`
}

func FetchTemplates

func FetchTemplates(ctx context.Context) ([]Template, error)

type WebPackageManager

type WebPackageManager string
const (
	NPM  WebPackageManager = "npm"
	PNPM WebPackageManager = "pnpm"
	Yarn WebPackageManager = "yarn"
)

func AutodetectWebPackageManagers

func AutodetectWebPackageManagers() ([]WebPackageManager, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL