api

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	DB database.DataBase
}

func GetHandler

func GetHandler(confPath string, sqlFile string) (handler *Handler, conf *config.Configuration, err error)

GetHandler Params: confPath - path to config, sqlFile - path to sql file Return: handler database, configuration, error Description: return databse handler

func Init

func Init(DB *database.DataBase) (handler *Handler)

Init Params: DB - database class Return: handler database Description: create database handler

func (*Handler) ForumCreate

func (h *Handler) ForumCreate(rw http.ResponseWriter, r *http.Request)

ForumCreate Params: http.ResponseWriter, *http.Request Description: create forum model, send created forum or message in json fromat

func (*Handler) ForumDetails

func (h *Handler) ForumDetails(rw http.ResponseWriter, r *http.Request)

ForumDetails Params: http.ResponseWriter, *http.Request Description: get forum model by slug, send forum or message in json fromat

func (*Handler) ForumThreads

func (h *Handler) ForumThreads(rw http.ResponseWriter, r *http.Request)

ForumThreads Params: http.ResponseWriter, *http.Request Description: fetches all forum threads' data and sends result in JSON format

func (*Handler) ForumUsers

func (h *Handler) ForumUsers(rw http.ResponseWriter, r *http.Request)

ForumUsers Params: http.ResponseWriter, *http.Request Description: fetches data about all forum's users and sends it JSON format

func (*Handler) ThreadCreate

func (h *Handler) ThreadCreate(rw http.ResponseWriter, r *http.Request)

ThreadCreate Params: http.ResponseWriter, *http.Request Description: creates thread, sends data in JSON format

func (*Handler) ThreadCreatePost

func (h *Handler) ThreadCreatePost(rw http.ResponseWriter, r *http.Request)

ThreadCreatePost Params: http.ResponseWriter, *http.Request Description: create posts in thread, send created post models array or message in json fromat

func (*Handler) ThreadDetails

func (h *Handler) ThreadDetails(rw http.ResponseWriter, r *http.Request)

ThreadDetails Params: http.ResponseWriter, *http.Request Description: fetches info about thread and sends it in JSON format

func (*Handler) ThreadPosts

func (h *Handler) ThreadPosts(rw http.ResponseWriter, r *http.Request)

ThreadPosts Params: http.ResponseWriter, *http.Request Description: get posts from thread, send post models array or message in json fromat

func (*Handler) ThreadUpdate

func (h *Handler) ThreadUpdate(rw http.ResponseWriter, r *http.Request)

ThreadUpdate Params: http.ResponseWriter, *http.Request Description: updates thread data with given info

func (*Handler) ThreadVote

func (h *Handler) ThreadVote(rw http.ResponseWriter, r *http.Request)

ThreadVote Params: http.ResponseWriter, *http.Request Description: receives users' vote (+1 or -1) to a given thread and updates current rating of a thread. Result sends in JSON format

func (*Handler) UserCreate

func (h *Handler) UserCreate(rw http.ResponseWriter, r *http.Request)

UserCreate Params: http.ResponseWriter, *http.Request Description: creates record of a new user in database, sends data in JSON format

func (*Handler) UserProfile

func (h *Handler) UserProfile(rw http.ResponseWriter, r *http.Request)

UserProfile Params: http.ResponseWriter, *http.Request Description: fetches info about user's profile and sends it in JSON format

Jump to

Keyboard shortcuts

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