template

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2022 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TOML string = "toml"
	YAML string = "yaml"
	JSON string = "json"
)

template constants

Variables

This section is empty.

Functions

This section is empty.

Types

type ProjectTemplate

type ProjectTemplate struct {
	Content []os.FileInfo
	Viper   *viper.Viper
	Config  TemplateConfig

	WorkingDirectory string
	// contains filtered or unexported fields
}

The full template struct

func (*ProjectTemplate) LoadScripts

func (self *ProjectTemplate) LoadScripts() error

Read the config file and load the data into template config

func (*ProjectTemplate) RunOnCreateScripts

func (self *ProjectTemplate) RunOnCreateScripts() error

Execute on create scripts

func (*ProjectTemplate) RunOnMountScripts

func (self *ProjectTemplate) RunOnMountScripts() error

Execute on mount scripts

type TemplateConfig

type TemplateConfig struct {
	Path       string
	ConfigType string
	Context    map[string]any
}

Set config for your configuration

type TemplateScripts

type TemplateScripts struct {
	UniversalScripts map[string][]exec.Cmd // `scripts_scope:"universal"`
	LinuxScripts     map[string][]exec.Cmd // `scripts_scope:"linux"`
	MacosScripts     map[string][]exec.Cmd // `scripts_scope:"macos"`
	WindowsScripts   map[string][]exec.Cmd // `scripts_scope:"windows"`
}

A set of scripts to execute

func (*TemplateScripts) Unmarshal

func (self *TemplateScripts) Unmarshal(scriptsScopeMap map[string]scriptsMap) error

Jump to

Keyboard shortcuts

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