template

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package template provides template for creating new plugins.

Index

Constants

This section is empty.

Variables

View Source
var BuildVersion = Target{
	Filepath: "BUILD_VERSION",
	Template: `v0.0.1`,
}

BuildVersion target

View Source
var Codeowners = Target{
	Filepath: "CODEOWNERS",
	Template: `* @vuil`,
}

Codeowners target TODO (pbarker): replace with the CLI reviewers group

View Source
var CommonMK = Target{
	Filepath: "common.mk",
	Template: plugintemplates.CommonMK,
}

CommonMK MK4 target

DefaultInitTargets are the default initialization targets.

View Source
var DefaultPluginTargets = []Target{
	PluginReadMe,
	PluginMain,
	PluginTest,
}

DefaultPluginTargets are the default plugin targets.

View Source
var GitHubCI = Target{
	Filepath: ".github/workflows/release.yaml",
	Template: plugintemplates.GithubWorkflowRelease,
}

GitHubCI target TODO (pbarker): should we push everything to a single repository, or at least make that possible? TODO (pbarker): should report stats

View Source
var GitIgnore = Target{
	Filepath: ".gitignore",
	Template: gitignore,
}

GitIgnore target

View Source
var GitLabCI = Target{
	Filepath: ".gitlab-ci.yaml",
	Template: plugintemplates.GitlabCI,
}

GitLabCI target

View Source
var GoMod = Target{
	Filepath: "go.mod",
	Template: plugintemplates.Gomod,
}

GoMod target

View Source
var GolangCIConfig = Target{
	Filepath: ".golangci.yaml",
	Template: plugintemplates.GolangCIConfig,
}

GolangCIConfig target.

View Source
var MainReadMe = Target{
	Filepath: "README.md",
	Template: plugintemplates.PluginReadme,
}

MainReadMe target

View Source
var Makefile = Target{
	Filepath: "Makefile",
	Template: plugintemplates.Makefile,
}

Makefile target

View Source
var PluginMain = Target{
	Filepath: "cmd/plugin/{{ .PluginName | ToLower }}/main.go",
	Template: plugintemplates.MainGo,
}

PluginMain target TODO (pbarker): proper logging

View Source
var PluginReadMe = Target{
	Filepath: "cmd/plugin/{{ .PluginName }}/README.md",
	Template: plugintemplates.CommandReadme,
}

PluginReadMe target

View Source
var PluginTest = Target{
	Filepath: "cmd/plugin/{{ .PluginName }}/test/main.go",
	Template: plugintemplates.MainTestGo,
}

PluginTest target

View Source
var Tools = Target{
	Filepath: "tools/tools.go",
	Template: plugintemplates.ToolsGo,
}

Tools target.

Functions

This section is empty.

Types

type Target

type Target struct {
	// Path of the file.
	Filepath string

	// Template to use.
	Template string
}

Target to template files.

func (Target) Run

func (t Target) Run(rootDir string, data interface{}, dryRun bool) error

Run the target.

Directories

Path Synopsis
Package plugintemplates provides templates for bootstrapping plugins.
Package plugintemplates provides templates for bootstrapping plugins.

Jump to

Keyboard shortcuts

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