scaffold

package
v8.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyInitialized = fmt.Errorf("project files already exist")

ErrAlreadyInitialized is used when scaffolding is being run on a project that is already setup.

Functions

This section is empty.

Types

type Manifest

type Manifest struct {
	Version string

	// Organize contains a mapping of files relative to Scaffold src, to be
	// copied into dst, relative to dst. Missing intermediate directories will
	// be created as needed.
	Organize map[string]string `json:"organize"`
}

Manifest defines the scaffold manifest model.

type Option

type Option func(*Scaffold)

Option defines a functional option that modifies a new Scaffold in the constructor.

func Force

func Force(force bool) Option

Force sets the force flag on a Scaffold, which determines whether existing destination files will be overwritten. Default is false.

type Scaffold

type Scaffold struct {
	// contains filtered or unexported fields
}

Scaffold defines a Vervet API project scaffold.

func New

func New(dst, src string, options ...Option) (*Scaffold, error)

New returns a new Scaffold loaded from source directory `src` for operation on destination directory `dst`. The Scaffold src must contain a `manifest.yaml` which defines how dst will be provisioned.

func (*Scaffold) Init

func (s *Scaffold) Init() error

Init runs a script called `init` in the scaffold source if present, in the destination directory.

func (*Scaffold) Organize

func (s *Scaffold) Organize() error

Organize provisions files from the scaffold source into its destination.

Jump to

Keyboard shortcuts

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