package
0.0.0-20220620005849-a315113d9162
Repository: https://github.com/mycodeku/transtionhelper.git
Documentation: pkg.go.dev
# Functions
AddLengthPrefix prefixes the byte array with its length as 8 bytes.
DecodeSequence converts the binary representation into an Uint64 value.
EncodeSequence converts the sequence value into the binary representation.
First loads the first element into the given destination type and closes the iterator.
LimitIterator returns a new iterator that returns max number of elements.
NewAutoUInt64Table creates a new AutoUInt64Table.
No description provided by the author
NewIndex builds a MultiKeyIndex.
NewIndexer returns an indexer that supports multiple reference keys for an entity.
Iterator that return ErrORMInvalidIterator only.
No description provided by the author
NewPrimaryKeyTable creates a new PrimaryKeyTable.
No description provided by the author
No description provided by the author
NewTypeSafeRowGetter returns a `RowGetter` with type check on the dest parameter.
NewUniqueIndex create a new Index object where duplicate keys are prohibited.
NewUniqueIndexer returns an indexer that requires exactly one reference keys for an entity.
NullTerminatedBytes converts string to byte array and null terminate it.
Paginate does pagination with a given Iterator based on the provided PageRequest and unmarshals the results into the dest interface that must be an non-nil pointer to a slice.
PrefixRange turns a prefix into a (start, end) range.
PrimaryKey returns the immutable and serialized primary key of this object.
ReadAll consumes all values for the iterator and stores them in a new slice at the passed ModelSlicePtr.
# Constants
EncodedSeqLength number of bytes used for the binary representation of a sequence value.
MaxBytesLen is the maximum allowed length for a key part of type []byte.
# Structs
AutoUInt64Table is the table type with an auto incrementing ID.
No description provided by the author
Indexer manages the persistence of an Index based on searchable keys and operations.
LimitedIterator returns up to defined maximum number of elements.
No description provided by the author
MultiKeyIndex is an index where multiple entries can point to the same underlying object as opposite to a unique index where only one entry is allowed.
PrimaryKeyTable provides simpler object style orm methods without passing database RowIDs.
sequence is a persistent unique key generator based on a counter.
No description provided by the author
# Interfaces
Index allows efficient prefix scans is stored as key = concat(indexKeyBytes, rowIDUint64) with value empty so that the row PrimaryKey is allows a fixed with 8 byte integer.
Indexable types are used to setup new tables.
Iterator allows iteration through a sequence of key value pairs.
ModelSlicePtr represents a pointer to a slice of models.
PrimaryKeyed defines an object type that is aware of its immutable primary key.
TableExportable.
Validateable is an interface that ProtoMarshaler types can implement and is called on any orm save or update operation.
# Type aliases
AfterDeleteInterceptor defines a callback function to be called on Delete operations.
AfterSetInterceptor defines a callback function to be called on Create + Update.
IndexerFunc creates one or multiple index keys for the source object.
IteratorFunc is a function type that satisfies the Iterator interface The passed function is called on LoadNext operations.
RowGetter loads a persistent object by row ID into the destination object.
Unique identifier of a persistent table.
IndexerFunc creates exactly one index key for the source object.