template

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package template provides template for creating new plugins.

Index

Constants

This section is empty.

Variables

View Source
var Codeowners = Target{
	Filepath: "CODEOWNERS",
	Template: `* # edit as appropriate`,
}

Codeowners target

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/build.yaml",
	Template: plugintemplates.GithubWorkflowBuild,
}

GitHubCI target

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

GitIgnore target

View Source
var GitLabCI = Target{
	Filepath: ".gitlab-ci.yml",
	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 PluginToolingMK = Target{
	Filepath: "plugin-tooling.mk",
	Template: plugintemplates.PluginToolingMK,
}

PluginToolingMK 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