🏷️ Created Content domain with HTML and plaintext content support
This commit is contained in:
parent
01f152b11a
commit
2485f65747
|
@ -0,0 +1,8 @@
|
||||||
|
package domain
|
||||||
|
|
||||||
|
import "golang.org/x/net/html"
|
||||||
|
|
||||||
|
type Content struct {
|
||||||
|
HTML *html.Node
|
||||||
|
Text string
|
||||||
|
}
|
|
@ -13,7 +13,7 @@ type Entry struct {
|
||||||
DeletedAt time.Time
|
DeletedAt time.Time
|
||||||
Title string // p-name
|
Title string // p-name
|
||||||
Description string // p-summary
|
Description string // p-summary
|
||||||
Content []byte // e-content
|
Content Content // e-content
|
||||||
PublishedAt time.Time // dt-published
|
PublishedAt time.Time // dt-published
|
||||||
UpdatedAt time.Time // dt-updated
|
UpdatedAt time.Time // dt-updated
|
||||||
// TODO(toby3d): Author string // p-author
|
// TODO(toby3d): Author string // p-author
|
||||||
|
@ -59,11 +59,11 @@ func TestEntry(tb testing.TB) *Entry {
|
||||||
Title: "Lorem ipsum",
|
Title: "Lorem ipsum",
|
||||||
Description: "Ut enim ad minim veniam, quis nostrud exercitation " +
|
Description: "Ut enim ad minim veniam, quis nostrud exercitation " +
|
||||||
"ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
"ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
||||||
Content: []byte("Duis aute irure dolor in reprehenderit in " +
|
Content: Content{Text: "Duis aute irure dolor in reprehenderit in " +
|
||||||
"voluptate velit esse cillum dolore eu fugiat nulla " +
|
"voluptate velit esse cillum dolore eu fugiat nulla " +
|
||||||
"pariatur. Excepteur sint occaecat cupidatat non proident," +
|
"pariatur. Excepteur sint occaecat cupidatat non proident," +
|
||||||
" sut in culpa qui officia deserunt mollit anim id est " +
|
" sut in culpa qui officia deserunt mollit anim id est " +
|
||||||
"laborum."),
|
"laborum."},
|
||||||
Tags: []string{"lorem", "ipsum", "dor"},
|
Tags: []string{"lorem", "ipsum", "dor"},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue