template

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NameGoContentTpl = `package [[ .Name | format ]]

// TODO(dtm): Add your logic here.
`
View Source
var NameGoDirTpl = "internal/pkg/plugin/[[ .Name | dirFormat ]]/"
View Source
var NameGoMustExistFlag = true
View Source
var NameGoNameTpl = "[[ .Name | format  ]].go"
View Source
var NamePluginMdContentTpl string
View Source
var NamePluginMdDirTpl = "docs/plugins/"
View Source
var NamePluginMdNameTpl = "[[ .Name ]].md"
View Source
var NamePluginZhMdContentTpl string
View Source
var NamePluginZhMdDirTpl = "docs/plugins/"
View Source
var NamePluginZhMdNameTpl = "[[ .Name ]].zh.md"
View Source
var ReadmeWhenCreatePluginMdContentTpl = `` /* 144-byte string literal not displayed */
View Source
var ReadmeWhenCreatePluginMdDirTpl = "./"
View Source
var ReadmeWhenCreatePluginMdNameTpl = "README_when_create_plugin.md"
View Source
var SpecialPluginNameMap = map[string]*SpecialPlugin{
	"gitlabci-golang":      NewSpecialPlugin("gitlabci/golang", "gitlabci"),
	"gitlabci-generic":     NewSpecialPlugin("gitlabci/generic", "generic"),
	"githubactions-golang": NewSpecialPlugin("githubactions/golang", "golang"),
	"githubactions-nodejs": NewSpecialPlugin("githubactions/nodejs", "nodejs"),
	"githubactions-python": NewSpecialPlugin("githubactions/python", "python"),
}
View Source
var TplFiles = make([]TplFile, 0)

TplFiles filled by functions at other go files. eg. internal/pkg/develop/plugin/template/create.go init()

Functions

func FormatPackageDirName added in v0.6.0

func FormatPackageDirName(name string) string

func FormatPackageName added in v0.5.0

func FormatPackageName(name string) string

Types

type File

type File struct {
	Name          string
	Dir           string
	Content       string
	MustExistFlag bool
}

File is a rendered TplFile that doesn't contain any template tags like "[[ .Name ]]".

type SpecialPlugin added in v0.6.0

type SpecialPlugin struct {
	DirName     string
	PackageName string
}

func NewSpecialPlugin added in v0.6.0

func NewSpecialPlugin(dirName string, packageName string) *SpecialPlugin

type TplFile

type TplFile struct {
	NameTpl       string
	DirTpl        string
	ContentTpl    string
	MustExistFlag bool
}

TplFile is a file contains some template tags like "[[ .Name ]]". eg. internal/pkg/develop/plugin/template/create.go is a TplFile.

Jump to

Keyboard shortcuts

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