-
Notifications
You must be signed in to change notification settings - Fork 1
/
post.go
50 lines (41 loc) · 786 Bytes
/
post.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package reader
import (
"time"
)
type Post struct {
title string
url string
blogTitle string
blogURL string
publishedAt time.Time
tags []string
}
func LoadPost(title, url, blogTitle, blogURL string, publishedAt time.Time, tags []string) *Post {
post := Post{
title: title,
url: url,
blogTitle: blogTitle,
blogURL: blogURL,
publishedAt: publishedAt,
tags: tags,
}
return &post
}
func (p *Post) Title() string {
return p.title
}
func (p *Post) URL() string {
return p.url
}
func (p *Post) BlogTitle() string {
return p.blogTitle
}
func (p *Post) BlogURL() string {
return p.blogURL
}
func (p *Post) PublishedAt() time.Time {
return p.publishedAt
}
func (p *Post) Tags() []string {
return p.tags
}