github.com/icyphox/x@v0.0.355-0.20220311094250-029bd783e8b8/networkx/network.go (about) 1 package networkx 2 3 import ( 4 "time" 5 6 "github.com/gofrs/uuid" 7 ) 8 9 type Network struct { 10 ID uuid.UUID `json:"id" db:"id"` 11 12 // CreatedAt is a helper struct field for gobuffalo.pop. 13 CreatedAt time.Time `json:"-" db:"created_at"` 14 15 // UpdatedAt is a helper struct field for gobuffalo.pop. 16 UpdatedAt time.Time `json:"-" db:"updated_at"` 17 } 18 19 func (p Network) TableName() string { 20 return "networks" 21 } 22 23 func NewNetwork() *Network { 24 return &Network{ 25 ID: uuid.Must(uuid.NewV4()), 26 } 27 }