Documentation ¶
Index ¶
- type Author
- type Blog
- func (Blog) Add(a, b float64) float64
- func (Blog) HasTag(post Post, tag string) bool
- func (Blog) IsAdmin(author Author) bool
- func (Blog) IsZero(post Post) bool
- func (b Blog) PopularPosts() []Post
- func (b Blog) RecentPosts() []Post
- func (Blog) Sub(a, b float64) float64
- func (Blog) Title(post Post) string
- func (b Blog) TotalComments() int
- func (b Blog) TotalUpvotes() int
- func (Blog) WithID(posts []Post, id int) Post
- type Comment
- type Post
- type UserProfile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Author ¶ added in v1.14.0
type Author struct { ID int FirstName string LastName string Email string Profile UserProfile }
type Blog ¶ added in v1.14.0
type Blog struct { Posts []Post Authors map[int]Author TotalViews int TotalPosts int TotalLikes int }
func ExampleData ¶ added in v1.14.1
func ExampleData() Blog
func (Blog) PopularPosts ¶ added in v1.14.1
func (Blog) RecentPosts ¶ added in v1.14.1
func (Blog) TotalComments ¶ added in v1.14.1
func (Blog) TotalUpvotes ¶ added in v1.14.1
type Comment ¶ added in v1.14.0
func (Comment) AuthorEmail ¶ added in v1.14.1
type Post ¶ added in v1.14.0
type UserProfile ¶ added in v1.14.0
func (UserProfile) Age ¶ added in v1.14.1
func (u UserProfile) Age() int
Click to show internal directories.
Click to hide internal directories.