Documentation ¶ Index ¶ type Comment type CommentStore type Post type PostStore type Store type Thread type ThreadStore type User type UserStore Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Comment ¶ type Comment struct { ID uuid.UUID `db:"id"` PostID uuid.UUID `db:"post_id"` Content string `db:"content"` Votes int `db:"votes"` } type CommentStore ¶ type CommentStore interface { Comment(id uuid.UUID) (Comment, error) CommentsByPost(postID uuid.UUID) ([]Comment, error) CreateComment(c *Comment) error UpdateComment(c *Comment) error DeleteComment(id uuid.UUID) error } type Post ¶ type Post struct { ID uuid.UUID `db:"id"` ThreadID uuid.UUID `db:"thread_id"` Title string `db:"title"` Content string `db:"content"` Votes int `db:"votes"` CommentsCount int `db:"comments_count"` ThreadTitle string `db:"thread_title"` } type PostStore ¶ type PostStore interface { Post(id uuid.UUID) (Post, error) Posts() ([]Post, error) PostsByThread(threadID uuid.UUID) ([]Post, error) CreatePost(p *Post) error UpdatePost(p *Post) error DeletePost(id uuid.UUID) error } type Store ¶ type Store interface { ThreadStore PostStore CommentStore UserStore } type Thread ¶ type Thread struct { ID uuid.UUID `db:"id"` Title string `db:"title"` Description string `db:"description"` } type ThreadStore ¶ type ThreadStore interface { Thread(id uuid.UUID) (Thread, error) Threads() ([]Thread, error) CreateThread(t *Thread) error UpdateThread(t *Thread) error DeleteThread(id uuid.UUID) error } type User ¶ type User struct { ID uuid.UUID `db:"id"` Username string `db:"username"` Password string `db:"password"` } type UserStore ¶ type UserStore interface { User(id uuid.UUID) (User, error) UserByUsername(username string) (User, error) CreateUser(u *User) error UpdateUser(u *User) error DeleteUser(id uuid.UUID) error } Source Files ¶ View all Source files goddit.go Directories ¶ Show internal Expand all Path Synopsis cmd goddit postgres web Click to show internal directories. Click to hide internal directories.