Skip to content

Instantly share code, notes, and snippets.

@jquiterio
jquiterio / messaging_systems.csv
Created September 16, 2023 18:31
messaging_systems_i_found
name pros cons
nats robust and well documented too big for my small requirements
mainflux well maintained and many tech suppor focused on IOT. A bit hard to understand
type Planet struct {
ID uint `gorm:"primaryKey;autoIncrement"`
Name string `gorm:"unique;type:string;size:100"`
NumSatellites uint32
Specs JSONMap
}
import (
"github.com/jquiterio/uuid"
)
var Planets []Planet
var Galaxies []Galaxy
type Planet {
ID uuid
Name string
package main
import (
"fmt"
"gorm.io/datatypes"
"gorm.io/driver/postgres"
"gorm.io/gorm"
)
@jquiterio
jquiterio / json_map.go
Last active March 11, 2024 19:53
JSONMap definition for gorm
import (
"database/sql/driver"
"encoding/json"
"errors"
"fmt"
"gorm.io/gorm"
"gorm.io/gorm/schema"
)
// JSONMap defiend JSON data type, need to implements driver.Valuer, sql.Scanner interface