mirror of https://github.com/VinGarcia/ksql.git
Add deprecation notices on all functions of the kstructs package
parent
06b871a418
commit
3ce7f53084
kstructs
|
@ -19,6 +19,8 @@ import (
|
||||||
// This function is efficient in the fact that it caches
|
// This function is efficient in the fact that it caches
|
||||||
// the slower steps of the reflection required to perform
|
// the slower steps of the reflection required to perform
|
||||||
// this task.
|
// this task.
|
||||||
|
//
|
||||||
|
// deprecated: Use ksqltest.StructToMap() instead
|
||||||
func StructToMap(obj interface{}) (map[string]interface{}, error) {
|
func StructToMap(obj interface{}) (map[string]interface{}, error) {
|
||||||
return structs.StructToMap(obj)
|
return structs.StructToMap(obj)
|
||||||
}
|
}
|
||||||
|
@ -29,6 +31,8 @@ func StructToMap(obj interface{}) (map[string]interface{}, error) {
|
||||||
// The first argument is any struct you are passing to a ksql func,
|
// 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
|
// and the second is a map representing a database row you want
|
||||||
// to use to update this struct.
|
// to use to update this struct.
|
||||||
|
//
|
||||||
|
// deprecated: Use ksqltest.FillStructWith() instead
|
||||||
func FillStructWith(record interface{}, dbRow map[string]interface{}) error {
|
func FillStructWith(record interface{}, dbRow map[string]interface{}) error {
|
||||||
v := reflect.ValueOf(record)
|
v := reflect.ValueOf(record)
|
||||||
t := v.Type()
|
t := v.Type()
|
||||||
|
@ -83,6 +87,8 @@ func FillStructWith(record interface{}, dbRow map[string]interface{}) error {
|
||||||
// The first argument is any slice of structs you are passing to a ksql func,
|
// 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
|
// and the second is a slice of maps representing the database rows you want
|
||||||
// to use to update this struct.
|
// to use to update this struct.
|
||||||
|
//
|
||||||
|
// deprecated: Use ksqltest.FillSliceWith() instead
|
||||||
func FillSliceWith(entities interface{}, dbRows []map[string]interface{}) error {
|
func FillSliceWith(entities interface{}, dbRows []map[string]interface{}) error {
|
||||||
sliceRef := reflect.ValueOf(entities)
|
sliceRef := reflect.ValueOf(entities)
|
||||||
sliceType := sliceRef.Type()
|
sliceType := sliceRef.Type()
|
||||||
|
@ -121,6 +127,8 @@ func FillSliceWith(entities interface{}, dbRows []map[string]interface{}) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// CallFunctionWithRows was created for helping test the QueryChunks method
|
// CallFunctionWithRows was created for helping test the QueryChunks method
|
||||||
|
//
|
||||||
|
// deprecated: Use ksqltest.CallFunctionWithRows() instead
|
||||||
func CallFunctionWithRows(fn interface{}, rows []map[string]interface{}) error {
|
func CallFunctionWithRows(fn interface{}, rows []map[string]interface{}) error {
|
||||||
fnValue := reflect.ValueOf(fn)
|
fnValue := reflect.ValueOf(fn)
|
||||||
chunkType, err := structs.ParseInputFunc(fn)
|
chunkType, err := structs.ParseInputFunc(fn)
|
||||||
|
|
Loading…
Reference in New Issue