Documentation
¶
Overview ¶
Package schema defines entity and field metadata for AQL queries.
Index ¶
Constants ¶
View Source
const CustomFieldPrefix = "custom."
CustomFieldPrefix is the prefix for custom field names.
Variables ¶
This section is empty.
Functions ¶
func AllEntities ¶
func AllEntities() map[ast.EntityType]*Entity
AllEntities returns all entity schemas.
func CustomFieldName ¶
CustomFieldName extracts the custom field name without the prefix.
func IsCustomFieldName ¶
IsCustomFieldName returns true if the field name indicates a custom field.
Types ¶
type Entity ¶
type Entity struct {
Name ast.EntityType
DisplayName string
Fields map[string]*Field
}
Entity represents an Aha entity type with its metadata.
func GetEntity ¶
func GetEntity(entityType ast.EntityType) *Entity
GetEntity returns the entity schema for the given entity type.
type Field ¶
type Field struct {
// Name is the field name.
Name string
// Type is the field's data type.
Type FieldType
// Filterable indicates if the field can be used in WHERE clauses.
Filterable bool
// Sortable indicates if the field can be used in ORDER BY clauses.
Sortable bool
// APIParam is the Aha API parameter name for this field.
// If empty, the field can only be filtered client-side.
APIParam string
// CustomField indicates if this is a custom field (prefixed with "custom.").
CustomField bool
}
Field represents a field definition in an entity schema.
func (*Field) IsPushable ¶
IsPushable returns true if filters on this field can be pushed to the Aha API.
Click to show internal directories.
Click to hide internal directories.