appboot

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name template Name
	Name = "Name"
	// Path template Path
	Path = "Path"

	// ConfigFolder appboot configuration items
	ConfigFolder = "appboot"
)

Variables

This section is empty.

Functions

func Create

func Create(app Application,
	force bool,
	beforeScripts []string,
	afterScripts []string,
	skipBeforeScripts bool,
	skipAfterScripts bool) error

Create an application

func CreateWithCallback

func CreateWithCallback(app Application,
	force bool,
	beforeScripts []string,
	afterScripts []string,
	skipBeforeScripts bool,
	skipAfterScripts bool,
	callback *CreateCallback) error

CreateWithCallback create an application with callback

func GetTemplates

func GetTemplates() []string

GetTemplates get templates

func GetTemplatesGitHash added in v0.5.0

func GetTemplatesGitHash() string

func UpdateAllTemplates

func UpdateAllTemplates() error

UpdateAllTemplates update all templates with git

func UpdateAllTemplatesWithDownloader

func UpdateAllTemplatesWithDownloader(downloader Downloader) error

UpdateAllTemplatesWithDownloader update all templates

func UpdateTemplate

func UpdateTemplate(name string) error

UpdateTemplate update template with Git

func UpdateTemplateWithDownloader

func UpdateTemplateWithDownloader(name string, downloader Downloader) error

UpdateTemplateWithDownloader update template

Types

type Application

type Application struct {
	Name       string
	Path       string
	Template   string
	Parameters string
}

Application data struct

func (*Application) Clean

func (app *Application) Clean()

Clean clean config folder

func (Application) CreateFiles

func (app Application) CreateFiles() error

CreateFiles create files

func (*Application) Description

func (app *Application) Description() string

Description application description

func (*Application) GetParameters

func (app *Application) GetParameters() (map[string]string, error)

GetParameters get application parameters

func (*Application) GetTemplatePath

func (app *Application) GetTemplatePath() string

GetTemplatePath application template path

func (*Application) IsValid

func (app *Application) IsValid() bool

IsValid is it valid

type Callback

type Callback func(app Application) error

Callback app callback

type CreateCallback

type CreateCallback struct {
	OnCreating Callback
	DidCreated Callback
}

CreateCallback create callback

type Downloader

type Downloader interface {
	Run(source string, destination string) error
}

Downloader downloader interface

func NewDownloader

func NewDownloader() Downloader

NewDownloader new downloader

type FloatParameter

type FloatParameter struct {
	Parameter
	Min     float64 `yaml:"min" json:"min"`
	Max     float64 `yaml:"max" json:"max"`
	Default float64 `yaml:"default" json:"default"`
}

FloatParameter float parameter

type IntParameter

type IntParameter struct {
	Parameter
	Min     int `yaml:"min" json:"min"`
	Max     int `yaml:"max" json:"max"`
	Default int `yaml:"default" json:"default"`
}

IntParameter int parameter

type Parameter added in v0.4.0

type Parameter struct {
	Key  string `yaml:"key" json:"key"`
	Type string `yaml:"type" json:"type"`
	Tip  string `yaml:"tip" json:"tip"`
}

type Scripts added in v0.4.0

type Scripts struct {
	Before []string `yaml:"before" json:"before"`
	After  []string `yaml:"after" json:"after"`
}

Scripts scripts

type SelectParameter

type SelectParameter struct {
	Parameter
	Options []string `yaml:"options" json:"options"`
	Default string   `yaml:"default" json:"default"`
}

SelectParameter select parameter

type StringParameter

type StringParameter struct {
	Parameter
	Default     string `yaml:"default" json:"default"`
	Placeholder string `yaml:"placeholder" json:"placeholder"`
}

type TemplateConfig

type TemplateConfig struct {
	Parameters []interface{} `yaml:"parameters" json:"parameters"`
	Desc       string        `yaml:"desc" json:"desc"`
	Scripts    Scripts       `yaml:"scripts" json:"scripts"`
}

TemplateConfig appboot config from appboot.yaml

func GetTemplateConfig

func GetTemplateConfig(template string) (*TemplateConfig, error)

GetTemplateConfig get template config

func GetTemplateConfigFromYaml

func GetTemplateConfigFromYaml(yamlPath string) (config *TemplateConfig, err error)

GetTemplateConfigFromYaml get config from yaml path

func (*TemplateConfig) UnmarshalYAML added in v0.4.0

func (p *TemplateConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshalYAML

Jump to

Keyboard shortcuts

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