Documentation ¶
Index ¶
- type Category
- type ForumMessage
- type Message
- type UserController
- func (u *UserController) AddMessage(w http.ResponseWriter, r *http.Request)
- func (u *UserController) GetCategories(w http.ResponseWriter, r *http.Request)
- func (u *UserController) GetCategory(w http.ResponseWriter, r *http.Request)
- func (u *UserController) GetMessages(w http.ResponseWriter, r *http.Request)
- func (u *UserController) GetSubcategories(w http.ResponseWriter, r *http.Request)
- func (u *UserController) NewRouter() *mux.Router
- func (c *UserController) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct { Id uuid.UUID `json:"id"` Name string `json:"name"` ParentId sql.NullString `json:"parent_id,omitempty"` }
type ForumMessage ¶
type ForumMessage struct { Id uuid.UUID `json:"id"` AuthorId string `json:"author_id"` AuthorName string `json:"author_name"` Text string `json:"text"` PostedAt time.Time `json:"posted_at"` }
ForumMessage represents messages in /message
type Message ¶
type Message struct { Id uuid.UUID `json:"id"` Text string `json:"text"` CategoryId uuid.UUID `json:"category_id"` PostedAt time.Time `json:"posted_at"` AuthorId uuid.UUID `json:"author_id"` }
Message represents message instance from DB
type UserController ¶
type UserController struct {
// contains filtered or unexported fields
}
func New ¶
func New(db *sql.DB) *UserController
func (*UserController) AddMessage ¶
func (u *UserController) AddMessage(w http.ResponseWriter, r *http.Request)
func (*UserController) GetCategories ¶
func (u *UserController) GetCategories(w http.ResponseWriter, r *http.Request)
func (*UserController) GetCategory ¶
func (u *UserController) GetCategory(w http.ResponseWriter, r *http.Request)
func (*UserController) GetMessages ¶
func (u *UserController) GetMessages(w http.ResponseWriter, r *http.Request)
func (*UserController) GetSubcategories ¶
func (u *UserController) GetSubcategories(w http.ResponseWriter, r *http.Request)
func (*UserController) NewRouter ¶
func (u *UserController) NewRouter() *mux.Router
func (*UserController) ServeHTTP ¶
func (c *UserController) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.