Documentation
¶
Overview ¶
Package tmpl provides templating utilities for goreleaser.
Index ¶
- type Error
- type ExpectedSingleEnvErr
- type Fields
- type Template
- func (t *Template) Apply(s string) (string, error)
- func (t *Template) ApplyAll(sps ...*string) error
- func (t *Template) ApplySingleEnvOnly(s string) (string, error)
- func (t *Template) Bool(s string) (bool, error)
- func (t *Template) WithArtifact(a *artifact.Artifact) *Template
- func (t *Template) WithBuildOptions(opts build.Options) *Template
- func (t *Template) WithEnv(e map[string]string) *Template
- func (t *Template) WithEnvS(envs []string) *Template
- func (t *Template) WithExtraFields(f Fields) *Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶ added in v1.21.0
type Error struct {
// contains filtered or unexported fields
}
Error is returned on any template error.
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 (*Template) ApplyAll ¶ added in v1.19.2
ApplyAll applies all the given strings against the Fields stored in the template. Application stops as soon as an error is encountered.
func (*Template) ApplySingleEnvOnly ¶ added in v0.139.0
ApplySingleEnvOnly enforces template to only contain a single environment variable and nothing else.
func (*Template) WithArtifact ¶
WithArtifact populates Fields from the artifact.
func (*Template) WithBuildOptions ¶ added in v0.132.0
func (*Template) WithEnv ¶ added in v0.104.2
WithEnv overrides template's env field with the given environment map.
func (*Template) WithEnvS ¶ added in v0.104.2
WithEnvS overrides template's env field with the given KEY=VALUE list of environment variables.
func (*Template) WithExtraFields ¶ added in v0.130.0
WithExtraFields allows to add new more custom fields to the template. It will override fields with the same name.