params

package
v0.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package params gives templates the parameters of a mock server, as text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameters

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

Parameters gives templates the app parameters as text: {{ .Parameters.Get "key" }}. A parameter that may be missing reads with Has first: {{ if .Parameters.Has "key" }}.

func New

func New(ctx context.Context, kv vlatte.KV) *Parameters

New returns the Parameters of kv, read with ctx.

func (*Parameters) Get

func (p *Parameters) Get(key string) (string, error)

Get returns the value stored under key as text. A key that isn't stored is an error, as a missing map key is, so a typo doesn't render as an empty value.

func (*Parameters) Has

func (p *Parameters) Has(key string) (bool, error)

Has reports whether a value is stored under key.

Jump to

Keyboard shortcuts

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