tmpl

package
v1.11.4 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package tmpl provides templating utilities for goreleaser.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExpectedSingleEnvErr added in v0.139.0

type ExpectedSingleEnvErr struct{}

func (ExpectedSingleEnvErr) Error added in v0.139.0

func (e ExpectedSingleEnvErr) Error() string

type Fields added in v0.130.0

type Fields map[string]interface{}

Fields that will be available to the template engine.

type Template

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

Template holds data that can be applied to a template string.

func New

func New(ctx *context.Context) *Template

New Template.

func (*Template) Apply

func (t *Template) Apply(s string) (string, error)

Apply applies the given string against the Fields stored in the template.

func (*Template) ApplySingleEnvOnly added in v0.139.0

func (t *Template) ApplySingleEnvOnly(s string) (string, error)

ApplySingleEnvOnly enforces template to only contain a single environment variable and nothing else.

func (*Template) WithArtifact

func (t *Template) WithArtifact(a *artifact.Artifact, replacements map[string]string) *Template

WithArtifact populates Fields from the artifact and replacements.

func (*Template) WithBuildOptions added in v0.132.0

func (t *Template) WithBuildOptions(opts build.Options) *Template

func (*Template) WithEnv added in v0.104.2

func (t *Template) WithEnv(e map[string]string) *Template

WithEnv overrides template's env field with the given environment map.

func (*Template) WithEnvS added in v0.104.2

func (t *Template) WithEnvS(envs []string) *Template

WithEnvS overrides template's env field with the given KEY=VALUE list of environment variables.

func (*Template) WithExtraFields added in v0.130.0

func (t *Template) WithExtraFields(f Fields) *Template

WithExtraFields allows to add new more custom fields to the template. It will override fields with the same name.

Jump to

Keyboard shortcuts

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