schema

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteBodyFields

func DeleteBodyFields(
	ctx context.Context,
	bodyParams Params,
	t *godog.Table,
) (interface{}, error)

DeleteBodyFields Returns body from schema file with code deleting fields.

func DeleteResponseFields

func DeleteResponseFields(
	ctx context.Context,
	bodyParams Params,
	t *godog.Table,
) (interface{}, error)

DeleteResponseFields Returns response from schema file without some params.

func FindValueByCode

func FindValueByCode(dataStruct []map[string]interface{}, code, param string) (interface{}, error)

FindValueByCode Find value by code and param from dataStruct

func GetBody

func GetBody(
	bodyParams Params,
) (interface{}, error)

GetBody Returns body from schema file with code.

func GetParam

func GetParam(bodyParams Params, param string) (interface{}, error)

GetParam Retrieve values from JSON structure file assets

func JSONEquals

func JSONEquals(expected, current interface{}) bool

JSONEquals Check if unmarshalled JSON maps are equal

func LoadData

func LoadData(file string) ([]byte, error)

LoadData Load file contents into bytes

func ModifyBody

func ModifyBody(
	ctx context.Context,
	bodyParams Params,
	t *godog.Table,
) (interface{}, error)

ModifyBody Returns body from schema file with code modifying values.

func ModifyResponse

func ModifyResponse(
	ctx context.Context,
	bodyParams Params,
	t *godog.Table,
) (interface{}, error)

ModifyResponse Returns modified response from schema file

func UnmarshalData

func UnmarshalData(data []byte) ([]map[string]interface{}, error)

UnmarshalData Unmarshal bytes to json map struct

func WriteMultipartBodyFields added in v0.18.0

func WriteMultipartBodyFields(
	ctx context.Context,
	w *multipart.Writer,
	t *godog.Table,
) error

WriteMultipartBodyFields Writes all multipart body fields.

func WriteMultipartBodyFile added in v0.18.0

func WriteMultipartBodyFile(w *multipart.Writer, fieldName, file string) error

WriteMultipartBodyFile Writes file on multipart body.

Types

type Params

type Params struct {
	File string
	Code string
}

Jump to

Keyboard shortcuts

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