Documentation
¶
Index ¶
- func ConvertAnyToType(v any, to tablecolumn.Type) any
- func ConvertStringToType(v string, to tablecolumn.Type) (any, error)
- func TryDecodeJsonArray[T any](raw string) ([]T, error)
- func ZeroValue(tp tablecolumn.Type) (any, error)
- type CellValueTyped
- type ColumnIndexer
- func (ci *ColumnIndexer) ColumnNames() []string
- func (ci *ColumnIndexer) GetColumnByIndex(index int) (*ent.TableColumn, error)
- func (ci *ColumnIndexer) GetColumnByNanoid(id string) (*ent.TableColumn, error)
- func (ci *ColumnIndexer) GetColumnIndexByNanoid(id string) (int, error)
- func (ci *ColumnIndexer) RowMapToSlice(row map[string]*schema.CellValue) ([]*schema.CellValue, error)
- func (ci *ColumnIndexer) SliceToRowMap(row []*schema.CellValue) (map[string]*schema.CellValue, error)
- func (ci *ColumnIndexer) ToAPIRow(row map[string]*schema.CellValue) (map[string]any, error)
- func (ci *ColumnIndexer) ToAPIRowWIthType(row map[string]*schema.CellValue) (map[string]CellValueTyped, error)
- func (ci *ColumnIndexer) ToDisplayRow(row map[string]*schema.CellValue) (map[string]any, error)
- type Item
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertAnyToType ¶ added in v0.0.7
func ConvertAnyToType(v any, to tablecolumn.Type) any
func ConvertStringToType ¶ added in v0.0.7
func ConvertStringToType(v string, to tablecolumn.Type) (any, error)
func TryDecodeJsonArray ¶
TryDecodeJsonArray attempts to decode a JSON array from a raw string into a slice of type T. If any elements fail to decode, it continues processing the remaining elements and returns the first encountered error (or joins multiple errors). The successfully decoded elements are still included in the result.
Types ¶
type CellValueTyped ¶ added in v0.4.0
type CellValueTyped struct {
Value any `json:"value"`
Type tablecolumn.Type `json:"type"`
}
type ColumnIndexer ¶
type ColumnIndexer struct {
// contains filtered or unexported fields
}
func NewColumnIndexer ¶
func NewColumnIndexer(columns []*ent.TableColumn) *ColumnIndexer
func (*ColumnIndexer) ColumnNames ¶
func (ci *ColumnIndexer) ColumnNames() []string
func (*ColumnIndexer) GetColumnByIndex ¶
func (ci *ColumnIndexer) GetColumnByIndex(index int) (*ent.TableColumn, error)
func (*ColumnIndexer) GetColumnByNanoid ¶
func (ci *ColumnIndexer) GetColumnByNanoid(id string) (*ent.TableColumn, error)
func (*ColumnIndexer) GetColumnIndexByNanoid ¶
func (ci *ColumnIndexer) GetColumnIndexByNanoid(id string) (int, error)
func (*ColumnIndexer) RowMapToSlice ¶
func (*ColumnIndexer) SliceToRowMap ¶ added in v0.3.1
func (*ColumnIndexer) ToAPIRowWIthType ¶ added in v0.4.0
func (ci *ColumnIndexer) ToAPIRowWIthType(row map[string]*schema.CellValue) (map[string]CellValueTyped, error)
APIRow return a map of [columnName]CellValueTyped, used in worklfow terminal only
func (*ColumnIndexer) ToDisplayRow ¶ added in v0.0.2
ToDisplayRow return a map of [columnName]cellValue
Click to show internal directories.
Click to hide internal directories.