Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adage ¶
type Adage struct { ID uuid.UUID Body string Tags []string Author string Source string CreatedAt time.Time UpdatedAt time.Time }
Adage is an entry in the database
func DeserializeAdage ¶
DeserializeAdage converts a byte array into an Adage struct
func GetAdageFromAll ¶
GetAdageFromAll gets an Adage from anywhere in the database
func GetAdageFromCategories ¶
func (*Adage) Serialize ¶
Serialize converts the structure to a byte array for saving into the database. We're just going to serialize it to JSON for now. I messed around with the gob package and it's actually slower to initialize all the object and buffers for each serialization and trying to reuse components can lead to corrupt binaries. The other alternative is something like Protobufs but I'm not sure if it's worth the added complexity. Right now we should be trying to make sure we almost never serialize/deserialize underlying data and instead do everything through indexes.