structinfo

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsFieldKindSupported

func IsFieldKindSupported(k reflect.Kind) bool

IsFieldKindSupported checks if a specific reflect kind of the field is supported by the Builder.

func IsFieldModification

func IsFieldModification(name string, typeKind reflect.Kind) bool

Types

type FieldInfo

type FieldInfo struct {
	// Name contains name of the field.
	Name string
	// OverrideColumnName is the name of the column in the database table.
	OverrideColumnName string
	// OverrideColumnType is the type of the column in the database table.
	OverrideColumnType string
	// Default contains default value for the field.
	Default string
	// Unique is set to true if the field is marked with a tag 'uniq'.
	Unique bool
	// Password is set to true if the field is marked with a "password" tag.
	Password bool
	// Ignored is set to true if the field is marked with a "-" tag.
	Ignored bool
}

type StructInfo

type StructInfo struct {
	// Name of the struct.
	Name string
	// ModificationFields indicates whether the struct has the following fields: CreatedAt, CreatedBy, ModifiedAt, ModifiedBy.
	ModificationFields bool
	// TableName is the name of the table in the database.
	TableName string
	// AliasedColumnNames set to true indicates that some column names are in a format of "alias.column_name".
	AliasedColumnNames bool
	// Fields contains info on fields.
	Fields map[string]*FieldInfo
	// FieldNames contains an ordered list of field names.
	FieldNames []string
	// UniqueFields contains a list of field names that are marked with a tag 'uniq'.
	UniqueFields []string
	// PasswordFields contains a list of field names that are marked with a tag 'pass'.
	PasswordFields []string
}

func New

func New(obj interface{}, tagName string) *StructInfo

Jump to

Keyboard shortcuts

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