Documentation
¶
Overview ¶
Package model provides model registration and metadata management for DynamORM
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldMetadata ¶
type FieldMetadata struct {
Name string // Go field name
Type reflect.Type // Go type
DBName string // DynamoDB attribute name
Index int // Field index in struct
Tags map[string]string // Parsed tags
IsPK bool // Is partition key
IsSK bool // Is sort key
IsVersion bool // Is version field
IsTTL bool // Is TTL field
IsCreatedAt bool // Is created_at field
IsUpdatedAt bool // Is updated_at field
IsSet bool // Should be stored as DynamoDB set
OmitEmpty bool // Omit if empty
IndexInfo map[string]IndexRole // Index participation
}
FieldMetadata holds metadata for a single field
type IndexSchema ¶
type IndexSchema struct {
Name string
Type IndexType
PartitionKey *FieldMetadata
SortKey *FieldMetadata
ProjectionType string
ProjectedFields []string
Sparse bool
}
IndexSchema represents a GSI or LSI schema
type KeySchema ¶
type KeySchema struct {
PartitionKey *FieldMetadata
SortKey *FieldMetadata
}
KeySchema represents a primary key or index key schema
type Metadata ¶
type Metadata struct {
Type reflect.Type
TableName string
PrimaryKey *KeySchema
Indexes []IndexSchema
Fields map[string]*FieldMetadata
FieldsByDBName map[string]*FieldMetadata
VersionField *FieldMetadata
TTLField *FieldMetadata
CreatedAtField *FieldMetadata
UpdatedAtField *FieldMetadata
}
Metadata holds all metadata for a model
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages registered models and their metadata
func (*Registry) GetMetadata ¶
GetMetadata retrieves metadata for a model
func (*Registry) GetMetadataByTable ¶
GetMetadataByTable retrieves metadata by table name
Click to show internal directories.
Click to hide internal directories.