forum

package
v0.0.0-...-b30913e Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CategoryList []CategoryStruct
View Source
var CategoryNum int = 1
View Source
var ThreadList []ThreadStruct
View Source
var ThreadNum int = 1
View Source
var UserList []UserStruct
View Source
var UserNum int = 1

Functions

func CORSMiddleware

func CORSMiddleware() gin.HandlerFunc

CORSMiddleware middleware headers for any RESTful requests {{{

func ChangeReputation

func ChangeReputation(c *gin.Context)

func CheckToken

func CheckToken(c *gin.Context)

func CheckTokenUtility

func CheckTokenUtility(token string) int

func CreateThread

func CreateThread(c *gin.Context)

func GenerateCategory

func GenerateCategory()

func GenerateToken

func GenerateToken(strlen int) string

func GetAllCategories

func GetAllCategories(c *gin.Context)

func GetAllThreads

func GetAllThreads(c *gin.Context)

func GetTargetUser

func GetTargetUser(c *gin.Context)

func GetThread

func GetThread(c *gin.Context)

func GetUser

func GetUser(c *gin.Context)

func Login

func Login(c *gin.Context)

func Logout

func Logout(c *gin.Context)

func Registration

func Registration(c *gin.Context)

func SendPost

func SendPost(c *gin.Context)

func Start

func Start(args []string)

Types

type CategoryReq

type CategoryReq struct {
	Category int `form:"category" binding:"required"`
}

type CategoryStruct

type CategoryStruct struct {
	ID   int
	Name string
}

type GetThreadReq

type GetThreadReq struct {
	Thread int `form:"thread" binding:"required"`
}

type IDReq

type IDReq struct {
	ID int `form:"id" binding:"required"`
}

type LoginReq

type LoginReq struct {
	Login    string `form:"login" binding:"required"`
	Password string `form:"password" binding:"required"`
}

type PostReq

type PostReq struct {
	Token    string `form:"token" binding:"required"`
	Category int    `form:"category" binding:"required"`
	Thread   int    `form:"thread" binding:"required"`
	Text     string `form:"text" binding:"required"`
}

type PostStruct

type PostStruct struct {
	ID     int
	Author int
	Text   string
}

type PublicPostStruct

type PublicPostStruct struct {
	ID     int
	Author PublicUserStruct
	Text   string
}

type PublicThreadStruct

type PublicThreadStruct struct {
	ID       int
	Category int
	Title    string
	PostNum  int
	Posts    []PublicPostStruct
}

func ThreadToPublicThread

func ThreadToPublicThread(thread ThreadStruct) (error, PublicThreadStruct)

type PublicUserStruct

type PublicUserStruct struct {
	ID         int
	Login      string
	Text       string
	PostCount  int
	Reputation int
}

func GetUserUtility

func GetUserUtility(id int) (error, PublicUserStruct)

type RegistrationReq

type RegistrationReq struct {
	Login    string `form:"login" binding:"required"`
	Password string `form:"password" binding:"required"`
	Text     string `form:"text"`
}

type ReputationReq

type ReputationReq struct {
	Token  string `form:"token" binding:"required"`
	Target int    `form:"target" binding:"required"`
	Inc    bool   `form:"inc"`
}

type ThreadReq

type ThreadReq struct {
	Token    string `form:"token" binding:"required"`
	Category int    `form:"category" binding:"required"`
	Title    string `form:"title" binding:"required"`
	Text     string `form:"text" binding:"required"`
}

type ThreadStruct

type ThreadStruct struct {
	ID       int
	Category int
	Title    string
	PostNum  int
	Posts    []PostStruct
}

type TokenReq

type TokenReq struct {
	Token string `form:"token" binding:"required"`
}

type UserStruct

type UserStruct struct {
	ID         int
	Login      string
	Password   string
	Text       string
	Token      string
	PostCount  int
	Reputation int
}

Jump to

Keyboard shortcuts

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