tpl

package
v0.19.10 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	OS           string
	Arch         string
	Version      string
	VersionMajor string
	VersionMinor string
	VersionPatch string
	NakedVersion string
	ExeExtension string
}

Args holds templating args

func New

func New(v string, mapper mapping.Mapper) Args

New returns populated template Args

func (Args) Interpolate

func (a Args) Interpolate(m map[string]string)

Interpolate changes some values by others

func (Args) MatchFilters

func (a Args) MatchFilters(file string, filters []string) (bool, error)

MatchFilters matches a file against a list of template filters

We use a template to allow interpolation in binaries list (e.g. {{.OS}}-{{.Arch}}-{{.Version}}) Also, the top level directory, if present, is removed to allow an easier search For instance : ripgrep-13.0.0-x86_64-unknown-linux-musl/rg becomes ^rg$

func (Args) Render

func (a Args) Render(t string) (string, error)

Render a passed-in template agains args

Jump to

Keyboard shortcuts

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