app

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APP  = "scratch"
	VER  = "0.3.3"
	DESC = "Utility for generating blank files for apps and services"
)
View Source
const (
	OPT_NO_COLOR = "nc:no-color"
	OPT_HELP     = "h:help"
	OPT_VER      = "v:version"

	OPT_VERB_VER     = "vv:verbose-version"
	OPT_COMPLETION   = "completion"
	OPT_GENERATE_MAN = "generate-man"
)
View Source
const (
	VAR_NAME        = "NAME"
	VAR_SHORT_NAME  = "SHORT_NAME"
	VAR_VERSION     = "VERSION"
	VAR_DESC        = "DESC"
	VAR_DESC_README = "DESC_README"

	VAR_CODEBEAT_UUID  = "CODEBEAT_UUID"
	VAR_CODECLIMATE_ID = "CODECLIMATE_ID"

	VAR_SHORT_NAME_TITLE    = "SHORT_NAME_TITLE"
	VAR_SHORT_NAME_LOWER    = "SHORT_NAME_LOWER"
	VAR_SHORT_NAME_UPPER    = "SHORT_NAME_UPPER"
	VAR_SPEC_CHANGELOG_DATE = "SPEC_CHANGELOG_DATE"
)

Variables

This section is empty.

Functions

func Run added in v0.0.11

func Run(gitRev string, gomod []byte)

Run is main utility function

Types

type Template

type Template struct {
	Name string // Name of template
	Path string // Path to directory with template data

	Vars Variables // Variables
	Data []string  // List of files and directories of template
}

type VariableInfo

type VariableInfo struct {
	Desc      string
	Validator string
	IsDynamic bool
}

func (VariableInfo) IsValid

func (vi VariableInfo) IsValid(value string) bool

IsValid validates value

type VariableInfoStore

type VariableInfoStore struct {
	Info map[string]VariableInfo
	List []string
}

type Variables

type Variables map[string]string // name → value

func (Variables) Count

func (v Variables) Count() int

Count returns number of variables which requires user input

func (Variables) Has

func (v Variables) Has(name string) bool

Has returns true if map contains variable with given name

Jump to

Keyboard shortcuts

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