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 ¶
type Author struct { ID int FirstName string LastName string Email string Profile UserProfile }
type Blog ¶
type Blog struct { Posts []Post Authors map[int]Author TotalViews int TotalPosts int TotalLikes int }
func ExampleData ¶
func ExampleData() Blog
func (Blog) PopularPosts ¶
func (Blog) RecentPosts ¶
func (Blog) TotalComments ¶
func (Blog) TotalUpvotes ¶
type Comment ¶
func (Comment) AuthorEmail ¶
type Post ¶
type UserProfile ¶
func (UserProfile) Age ¶
func (u UserProfile) Age() int
Click to show internal directories.
Click to hide internal directories.