structreflect

package
v0.0.0-...-fff4862 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertDynamicToTyped

func ConvertDynamicToTyped[T any](obj any, t reflect.Type) (uint64, T, error)

func CreateDynamicStruct

func CreateDynamicStruct(t reflect.Type, fieldToJson map[string]string, depth int) reflect.Type

func GetJsonTagToValues

func GetJsonTagToValues(object any, fieldToJsonTags map[string]string) map[string]any

func GetUniqueConstraint

func GetUniqueConstraint[T any](object T) (uint64, *keyValue, error)

func IsDgraphType

func IsDgraphType(value any) bool

func IsStructAndNotDgraphType

func IsStructAndNotDgraphType(field reflect.StructField) bool

func IsValidUniqueIndex

func IsValidUniqueIndex(name string) bool

func MapDynamicToFinal

func MapDynamicToFinal(dynamic any, final any, isNested bool) (uint64, error)

Types

type DbTag

type DbTag struct {
	Constraint string
}

type TagMaps

type TagMaps struct {
	FieldToJson       map[string]string
	JsonToDb          map[string]*DbTag
	JsonToReverseEdge map[string]string
}

func GetFieldTags

func GetFieldTags(t reflect.Type) (*TagMaps, error)

Jump to

Keyboard shortcuts

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