scaffold

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package scaffold sets a service up for SPECTRE by rendering a template from a template repository into the spectre directory of its checkout with scaffolder.

A template's template.js runs before anything is written, so it can check the variables and throw to stop the run. The spectre_version variable defaults to the git tag or commit of the SPECTRE this binary is built from.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context, config Config) error

Init renders the template into the spectre directory of config.Dir, which must not exist yet unless config.Force is set.

Types

type Config

type Config struct {
	// Dir is the service checkout to set up.
	Dir string `` /* 137-byte string literal not displayed */
	// Template names the template to render.
	Template string `required:"" placeholder:"NAME" help:"Template to render, a directory at the root of the template repository."`
	// Repo holds the templates, one directory each.
	Repo string `` /* 170-byte string literal not displayed */
	// Force renders over an existing spectre directory.
	Force bool `short:"f" help:"Render over an existing spectre directory, overwriting the files the template writes."`
	// Vars are the template's variables.
	Vars map[string]string `` /* 175-byte string literal not displayed */
}

Config selects the template init renders and its variables.

Jump to

Keyboard shortcuts

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