template

package
v1.3.2-rc3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultParser

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

func NewParser

func NewParser(params ParserParams) (*DefaultParser, error)

func (*DefaultParser) Parse

func (p *DefaultParser) Parse(content string) (string, error)

Parse parses the template and replaces the placeholders with the values from the replacements map.

func (*DefaultParser) ParseBytes

func (p *DefaultParser) ParseBytes(content []byte) ([]byte, error)

ParseBytes parses the template and replaces the placeholders with the values from the replacements map.

type Parser

type Parser interface {
	// Parse parses the template and replaces the placeholders with the values a replacements map.
	Parse(content string) (string, error)
	// ParseBytes parses the template and replaces the placeholders with the values a replacements map.
	ParseBytes(content []byte) ([]byte, error)
}

type ParserParams

type ParserParams struct {
	Replacements map[string]string
	EnvPattern   string
}

Jump to

Keyboard shortcuts

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