controller

package
v0.0.0-...-2ae2cef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL