An experimental IndieWeb site built in Go.
1package models
2
3import (
4 "time"
5
6 "go.hacdias.com/indielib/microformats"
7 "gorm.io/datatypes"
8 "gorm.io/gorm"
9)
10
11type Post struct {
12 ID ULID `gorm:"primaryKey;unique"`
13
14 Type string
15 MicroformatType microformats.Type
16 Properties datatypes.JSON
17
18 CreatedAt time.Time
19 UpdatedAt time.Time
20 DeletedAt gorm.DeletedAt `gorm:"index"`
21}
22
23func (p *Post) Timestamp() string {
24 return p.CreatedAt.Format("01/02/2006 at 3:04 PM")
25}