detectors

package
v0.0.0-...-a2ff9df Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFieldShouldBeSkipped = errors.New("field is a relationship")

Functions

func ConvertFuncToInternalValueFuncAdapter

func ConvertFuncToInternalValueFuncAdapter(cf types.ConvertFunc) fields.InternalValueFunc

func ConvertFuncToRepresentationFuncAdapter

func ConvertFuncToRepresentationFuncAdapter(cf types.ConvertFunc) fields.RepresentationFunc

func FieldTypes

func FieldTypes[Model any]() map[string]string

Prints a summary with the fields of the model obtained using reflection

func Fields

func Fields[Model any]() []string

Types

type ToInternalValueDetector

type ToInternalValueDetector interface {
	ToInternalValue(fieldName string) (fields.InternalValueFunc, error)
}

func DefaultToInternalValueDetector

func DefaultToInternalValueDetector[Model any]() ToInternalValueDetector

type ToRepresentationDetector

type ToRepresentationDetector[Model any] interface {
	ToRepresentation(fieldName string) (fields.RepresentationFunc, error)
}

ToRepresentationDetector is an interface that allows to detect the representation function for a given field using well known interfaces, knowledge of stdlib types or any other way

func DefaultToRepresentationDetector

func DefaultToRepresentationDetector[Model any]() ToRepresentationDetector[Model]

Jump to

Keyboard shortcuts

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