Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Post ¶
type Post struct {
// contains filtered or unexported fields
}
Post is a domain model for the posts.
func NewPost ¶
NewPost returns a new instance of the Post domain model, providing the given data is valid. This function assumes userID is a valid user id.
func PostFromDao ¶
PostFromDao returns a new instance of Post, populated with the data from the data access object. This should only be used by the PostRepository, to instantiate new domain models.
func (*Post) CanLike ¶
CanLike determines if a user can like this post or not. An error is returned, if the user cannot like it.
func (*Post) CanUnlike ¶
CanUnlike determines if a user can unlike this post or not. An error is returned, if the user cannot unlike it.
func (*Post) ReferenceID ¶
ReferenceID returns the post's reference id.
func (*Post) SetReferenceID ¶
SetReferenceID sets the reference id of the post.