kstructs

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package kstructs is deprecated: use ksqltest instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallFunctionWithRows

func CallFunctionWithRows(fn interface{}, rows []map[string]interface{}) error

CallFunctionWithRows was created for helping test the QueryChunks method

deprecated: Use ksqltest.CallFunctionWithRows() instead

func FillSliceWith

func FillSliceWith(entities interface{}, dbRows []map[string]interface{}) error

FillSliceWith is meant to be used on unit tests to mock the response from the database.

The first argument is any slice of structs you are passing to a ksql func, and the second is a slice of maps representing the database rows you want to use to update this struct.

deprecated: Use ksqltest.FillSliceWith() instead

func FillStructWith

func FillStructWith(record interface{}, dbRow map[string]interface{}) error

FillStructWith is meant to be used on unit tests to mock the response from the database.

The first argument is any struct you are passing to a ksql func, and the second is a map representing a database row you want to use to update this struct.

deprecated: Use ksqltest.FillStructWith() instead

func StructToMap

func StructToMap(obj interface{}) (map[string]interface{}, error)

StructToMap converts any struct type to a map based on the tag named `ksql`, i.e. `ksql:"map_key_name"`

Valid pointers are dereferenced and copied to the map, null pointers are ignored.

This function is efficient in the fact that it caches the slower steps of the reflection required to perform this task.

deprecated: Use ksqltest.StructToMap() instead

Types

This section is empty.

Jump to

Keyboard shortcuts

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