This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Planet struct { | |
| ID uint `gorm:"primaryKey;autoIncrement"` | |
| Name string `gorm:"unique;type:string;size:100"` | |
| NumSatellites uint32 | |
| Specs JSONMap | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ( | |
| "github.com/jquiterio/uuid" | |
| ) | |
| var Planets []Planet | |
| var Galaxies []Galaxy | |
| type Planet { | |
| ID uuid | |
| Name string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "gorm.io/datatypes" | |
| "gorm.io/driver/postgres" | |
| "gorm.io/gorm" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |