templating

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDuration added in v0.17.2

func ParseDuration(s string) (time.Duration, error)

ParseDuration parses a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

Types

type Request

type Request struct {
	QueryParam map[string][]string
	Header     map[string][]string
	Path       []string
	Scheme     string
	Body       func(queryType, query string, options *raymond.Options) string

	Method string
	// contains filtered or unexported fields
}

type TemplatingData

type TemplatingData struct {
	Request         Request
	State           map[string]string
	CurrentDateTime func(string, string, string) string
}

func NewTemplatingDataFromRequest

func NewTemplatingDataFromRequest(requestDetails *models.RequestDetails, state map[string]string) *TemplatingData

type Templator added in v0.14.2

type Templator struct {
}

func NewTemplator added in v0.14.2

func NewTemplator() *Templator

func (*Templator) ParseTemplate added in v1.0.0

func (*Templator) ParseTemplate(responseBody string) (*raymond.Template, error)

func (*Templator) RenderTemplate added in v1.0.0

func (*Templator) RenderTemplate(tpl *raymond.Template, requestDetails *models.RequestDetails, state map[string]string) (string, error)

Jump to

Keyboard shortcuts

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