utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertList

func ConvertList(input interface{}, convertFunc ConvertFunc, output interface{}) error

ConvertList transforms input list of items into output list using convertFunc. "input" must be array or slice "output" must be a pointer to slice; a new slice is allocated and returned under that pointer

func ConvertOrNone

func ConvertOrNone(input interface{}, convertFunc ConvertFunc, output interface{}) error

ConvertOrNone transforms input into output using convertFunc, unless input is nil -> then sets output to nil. "input" must be a pointer eg *int "output" must be a pointer to pointer eg **int conversion result is stored under output, or nil is set if input is nil

func NewJSONPayloadInspector

func NewJSONPayloadInspector(t *testing.T, jsonString string) *jsonPayloadInspector

NewJSONPayloadInspector creates json inspector object for evaluating correctness of json document It uses XPath for addressing JSON fields

Types

type ConvertFunc

type ConvertFunc interface{}

ConvertFunc signature like: func IntToString(source int) (string, error)

Jump to

Keyboard shortcuts

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