| title | Tables Reference | |||
|---|---|---|---|---|
| description | Complete reference for all storage table types | |||
| author | zoobzio | |||
| published | 2025-01-01 | |||
| updated | 2025-01-06 | |||
| tags |
|
Complete reference for all storage tables.
Tables organize atomic values by type. Each table stores a specific category of values.
const TableStrings Table = "strings"Stores string values.
| Go Types | Storage Type |
|---|---|
string |
string |
Named string types (type X string) |
string |
Atom Field: Strings map[string]string
const TableInts Table = "ints"Stores signed integer values (normalized to int64).
| Go Types | Storage Type |
|---|---|
int, int8, int16, int32, int64 |
int64 |
Named int types (type X int) |
int64 |
Atom Field: Ints map[string]int64
Overflow: Values are validated during deatomization. Overflow returns an error.
const TableUints Table = "uints"Stores unsigned integer values (normalized to uint64).
| Go Types | Storage Type |
|---|---|
uint, uint8, uint16, uint32, uint64 |
uint64 |
Named uint types (type X uint) |
uint64 |
Atom Field: Uints map[string]uint64
const TableFloats Table = "floats"Stores floating-point values (normalized to float64).
| Go Types | Storage Type |
|---|---|
float32, float64 |
float64 |
Named float types (type X float64) |
float64 |
Atom Field: Floats map[string]float64
Overflow: float32 overflow detected during deatomization.
const TableBools Table = "bools"Stores boolean values.
| Go Types | Storage Type |
|---|---|
bool |
bool |
Named bool types (type X bool) |
bool |
Atom Field: Bools map[string]bool
const TableTimes Table = "times"Stores time values.
| Go Types | Storage Type |
|---|---|
time.Time |
time.Time |
Atom Field: Times map[string]time.Time
const TableBytes Table = "bytes"Stores byte slice values.
| Go Types | Storage Type |
|---|---|
[]byte |
[]byte |
[N]byte (fixed arrays) |
[]byte |
Named byte slices (type X []byte, e.g., net.IP) |
[]byte |
Atom Field: Bytes map[string][]byte
Note: Fixed arrays are validated for correct length during deatomization.
Pointer tables store optional values that can be nil.
const TableStringPtrs Table = "string_ptrs"Go Type: *string
Atom Field: StringPtrs map[string]*string
const TableIntPtrs Table = "int_ptrs"Go Types: *int, *int8, *int16, *int32, *int64
Atom Field: IntPtrs map[string]*int64
const TableUintPtrs Table = "uint_ptrs"Go Types: *uint, *uint8, *uint16, *uint32, *uint64
Atom Field: UintPtrs map[string]*uint64
const TableFloatPtrs Table = "float_ptrs"Go Types: *float32, *float64
Atom Field: FloatPtrs map[string]*float64
const TableBoolPtrs Table = "bool_ptrs"Go Type: *bool
Atom Field: BoolPtrs map[string]*bool
const TableTimePtrs Table = "time_ptrs"Go Type: *time.Time
Atom Field: TimePtrs map[string]*time.Time
const TableBytePtrs Table = "byte_ptrs"Go Type: *[]byte
Atom Field: BytePtrs map[string]*[]byte
Slice tables store arrays of values.
const TableStringSlices Table = "string_slices"Go Type: []string
Atom Field: StringSlices map[string][]string
const TableIntSlices Table = "int_slices"Go Types: []int, []int8, []int16, []int32, []int64
Atom Field: IntSlices map[string][]int64
const TableUintSlices Table = "uint_slices"Go Types: []uint, []uint8, []uint16, []uint32, []uint64
Atom Field: UintSlices map[string][]uint64
Note: []byte is stored in TableBytes, not here.
const TableFloatSlices Table = "float_slices"Go Types: []float32, []float64
Atom Field: FloatSlices map[string][]float64
const TableBoolSlices Table = "bool_slices"Go Type: []bool
Atom Field: BoolSlices map[string][]bool
const TableTimeSlices Table = "time_slices"Go Type: []time.Time
Atom Field: TimeSlices map[string][]time.Time
const TableByteSlices Table = "byte_slices"Go Type: [][]byte
Atom Field: ByteSlices map[string][][]byte
Map tables store string-keyed maps of values.
const TableStringMaps Table = "string_maps"Go Type: map[string]string
Atom Field: StringMaps map[string]map[string]string
const TableIntMaps Table = "int_maps"Go Types: map[string]int, map[string]int8, map[string]int16, map[string]int32, map[string]int64
Atom Field: IntMaps map[string]map[string]int64
const TableUintMaps Table = "uint_maps"Go Types: map[string]uint, map[string]uint8, map[string]uint16, map[string]uint32, map[string]uint64
Atom Field: UintMaps map[string]map[string]uint64
const TableFloatMaps Table = "float_maps"Go Types: map[string]float32, map[string]float64
Atom Field: FloatMaps map[string]map[string]float64
const TableBoolMaps Table = "bool_maps"Go Type: map[string]bool
Atom Field: BoolMaps map[string]map[string]bool
const TableTimeMaps Table = "time_maps"Go Type: map[string]time.Time
Atom Field: TimeMaps map[string]map[string]time.Time
const TableByteMaps Table = "byte_maps"Go Type: map[string][]byte
Atom Field: ByteMaps map[string]map[string][]byte
const TableNestedMaps Table = "nested_maps"Go Type: map[string]struct
Atom Field: NestedMaps map[string]map[string]Atom
Stores maps where values are structs, recursively atomized.
Nested structs don't use a Table constant. They're stored in:
| Type | Atom Field |
|---|---|
struct |
Nested map[string]Atom |
*struct |
Nested map[string]Atom (nil = no entry) |
[]struct |
NestedSlices map[string][]Atom |
[]*struct |
NestedSlices map[string][]Atom |
map[string]struct |
NestedMaps map[string]map[string]Atom |
func (t Table) Prefix() stringReturns string(t) + ":".
Useful for namespaced storage:
key := atom.TableStrings.Prefix() + "Name"
// "strings:Name"| Category | Tables |
|---|---|
| Scalar | strings, ints, uints, floats, bools, times, bytes |
| Pointer | *_ptrs variants |
| Slice | *_slices variants |
| Map | *_maps variants |
| Size | Tables |
|---|---|
| Variable | strings, bytes, all slices |
| 8 bytes | ints, uints, floats, times |
| 1 byte | bools |
Returns all 29 tables in canonical order:
tables := atom.AllTables()
// [strings ints uints floats bools times bytes
// byte_ptrs string_ptrs int_ptrs uint_ptrs float_ptrs bool_ptrs time_ptrs
// string_slices int_slices uint_slices float_slices bool_slices time_slices byte_slices
// string_maps int_maps uint_maps float_maps bool_maps time_maps byte_maps nested_maps]