Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Post ¶
type Post struct { ID string Timestamp int Name string Avatar string Body string ParentID string RepostID string RoomID string UpvoterIDs map[string]bool DownvoterIDs map[string]bool ReplyCount int }
func (Post) DownvoteCount ¶
func (Post) IsDownvoted ¶
func (Post) UpvoteCount ¶
type Repository ¶
type Repository interface { Save(post Post) error FindByID(id string) (*Post, error) FindByParentID(id string, first int, after string, sort bool) (*[]Post, error) FindByRoomID(id string, first int, after string, sort bool) (*[]Post, error) }
Repository interface
type Service ¶
type Service interface { Get(id string) (*Post, error) Feed(first int, after string) (*[]Post, error) Child(parentID string, first int, after string) (*[]Post, error) Rooms(roomID string, first int, after string) (*[]Post, error) Create(name string, avatar string, body string, parentID string, repostID string, roomID string) (*Post, error) Upvote(accountID string, postID string) (*Post, error) Downvote(accountID string, postID string) (*Post, error) }
func NewService ¶
func NewService(repo Repository) Service
Click to show internal directories.
Click to hide internal directories.