field

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ErrNilPointer    = utils.Error("ptr to struct to be parsed by field spec is nil")
	ErrInvalidStruct = utils.Error("field spec requires a pointer to a struct; invalid type")
)

Variables

This section is empty.

Functions

func AddReservedType

func AddReservedType(t string)

AddReservedType register a type as reserved

func GetReservedTypes

func GetReservedTypes() []string

GetReservedTypes get a copy of the list of reserved types

func IsReservedType

func IsReservedType(t string) bool

**

  • Check if a given type string is reserved
  • Reserved means the value is passed "as is"
  • This is a workaround to allow to pass struct-based types that are recognized by the driver

Types

type Metadata

type Metadata struct {
	Name       string `json:"fieldName"`  // actual field name
	DbName     string `json:"dbName"`     // database field name
	Alias      string `json:"fieldAlias"` // serialized name (json,xml, etc)
	Sortable   bool   `json:"sortable"`   // true if field is sortable
	Filterable bool   `json:"filterable"` // true if field is filterable
	Searchable bool   `json:"searchable"` // true if field is searchable
	Auto       bool   `json:"auto"`       // true if field is automatically generated
	OmitNil    bool   `json:"omitNil"`    // true if field is skipped on insert if nil
	OmitEmpty  bool   `json:"omitEmpty"`  // true if field is skipped on insert if empty
	TypeName   string `json:"typeName"`   // field type name (from reflect.Type.Name())
	Type       reflect.Type
	DbOptions  []string `json:"dbOptions"` // additional db options like goqu, etc
}

func GetStructMeta

func GetStructMeta(t reflect.Type) ([]Metadata, error)

Jump to

Keyboard shortcuts

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