template

package
v0.0.0-...-e40bcaf Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const BUILDMAKEFILE = `` /* 2993-byte string literal not displayed */

BUILDMAKEFILE build目录下的makefile需要和根目录下的makefile合并

View Source
const Centos8 = `` /* 708-byte string literal not displayed */

Centos8 rpm打包dockerfile

View Source
const Description = `` /* 195-byte string literal not displayed */

Description 版本描述

View Source
const Dockerfile = `` /* 1026-byte string literal not displayed */

Dockerfile 模版

View Source
const Gitignore = `{{.project}}
.vscode
bin
build/tgz
build/rpm/rpmbuild
`

Gitignore git的屏蔽模板

View Source
const GitlabCI = `` /* 2014-byte string literal not displayed */

GitlabCI 文件模板

View Source
const K8s = `` /* 622-byte string literal not displayed */

K8s 文件模板

View Source
const LibVersion = `` /* 1633-byte string literal not displayed */

LibVersion cmd/version.go模板

View Source
const License = `` /* 10923-byte string literal not displayed */

License apache协议

View Source
const MainGo = `
package main

import (
	"{{.importPath}}/cmd"
)

func main() {
	cmd.Execute()
}
`

MainGo main.go模板

View Source
const Makefile = `` /* 2216-byte string literal not displayed */

Makefile 模板

View Source
const RPMMAKEFILE = `` /* 1905-byte string literal not displayed */

RPMMAKEFILE 生成rpm包的makefile模板

View Source
const RPMSPEC = `` /* 1639-byte string literal not displayed */

RPMSPEC 生成rpm包的spec模板

View Source
const Readme = `
# {{.project}}
`

Readme 文档模板

View Source
const RootGo = `` /* 2108-byte string literal not displayed */

RootGo corba的roog.go模板

View Source
const Systemd = `` /* 777-byte string literal not displayed */

Systemd 模板

View Source
const Version = `` /* 426-byte string literal not displayed */

Version cmd/version.go模板

Variables

This section is empty.

Functions

func Create

func Create(c CreateTpl, mod string)

Create 解析模板创建文件

Types

type CreateTpl

type CreateTpl interface {
	Path() string
	Content() string
}

CreateTpl 创建模板的接口

type Pool

type Pool struct {
	// 文件类型:模板对象
	Templates map[string]*Template
}

Pool 模板对象集合

var Default Pool

Default 默认的模板池,所有的默认模板都在里面

func (*Pool) Add

func (p *Pool) Add(kind, tpl, path string)

Add kind文件类型 path为路径和文件名的组合

func (*Pool) All

func (p *Pool) All() map[string]*Template

All 获取所有模板对象

func (*Pool) Allkind

func (p *Pool) Allkind() string

Allkind 获取所有kind

func (*Pool) Get

func (p *Pool) Get(kind string) *Template

Get 获取指定kind的模板

type Template

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

Template 模板对象

func (*Template) Content

func (t *Template) Content() string

Content 返回模板内容

func (*Template) Path

func (t *Template) Path() string

Path 返回改模板需要创建的路径

Jump to

Keyboard shortcuts

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