templatetools

package
v2.14.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONObject

type JSONObject map[string]any

func NewJSONObject

func NewJSONObject(raw []byte) (JSONObject, error)

NewJSONObject is a function that creates a JSONObject from a raw JSON byte slice.

func (JSONObject) Delete

func (o JSONObject) Delete(key string)

Delete removes a key-value pair for the specified key from JSONObject.

func (JSONObject) Get

func (o JSONObject) Get(key string) any

Get returns the value associated with a specified key in the JSONObject. If requested key doesn't exist, nil is returned.

func (JSONObject) Parameterize

func (o JSONObject) Parameterize(key string) *value.ValueParameter

Parameterize replaces the value associated with a specified key in the JSONObject with a template placeholder.

func (JSONObject) ParameterizeAttributeWith

func (o JSONObject) ParameterizeAttributeWith(keyOfJSONAttribute string, nameOfParameter string) *value.ValueParameter

ParameterizeAttributeWith replace value of the given key with the given parameter name. The returned ValueParameter contains just replaced value for the given key.

func (JSONObject) ToJSON

func (o JSONObject) ToJSON() ([]byte, error)

ToJSON converts JSONObject to its []byte representation.

Jump to

Keyboard shortcuts

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