Documentation ¶
Index ¶
- Variables
- func CORSMiddleware() gin.HandlerFunc
- func CheckToken(c *gin.Context)
- func CreateComment(c *gin.Context)
- func CreatePost(c *gin.Context)
- func DeleteComment(c *gin.Context)
- func DeletePost(c *gin.Context)
- func EditPost(c *gin.Context)
- func GenerateToken(strlen int) string
- func GetAllPosts(c *gin.Context)
- func GetAuthData(c *gin.Context)
- func GetOnePost(c *gin.Context)
- func Login(c *gin.Context)
- func Logout(c *gin.Context)
- func SearchTag(c *gin.Context)
- func SearchText(c *gin.Context)
- func Start(args []string)
- type AuthData
- type AuthDataReq
- type CommentStruct
- type CommentStructReq
- type CommentTokenReq
- type IDReq
- type IDTokenReq
- type PostStruct
- type PostStructEditReq
- type PostStructReq
- type TagReq
- type TextSearchReq
- type TokenReq
Constants ¶
This section is empty.
Variables ¶
View Source
var AuthToken string = GenerateToken(12)
View Source
var CurrentPostID int = 1
View Source
var PostList []PostStruct
Functions ¶
func CORSMiddleware ¶
func CORSMiddleware() gin.HandlerFunc
CORSMiddleware middleware headers for any RESTful requests {{{
func CheckToken ¶
func CreateComment ¶
func CreatePost ¶
func DeleteComment ¶
func DeletePost ¶
func GenerateToken ¶
func GetAllPosts ¶
func GetAuthData ¶
func GetOnePost ¶
func SearchText ¶
Types ¶
type AuthData ¶
var CurrentAuthData AuthData = AuthData{ Login: randomdata.FirstName(randomdata.Female), Password: GenerateToken(5), }
type AuthDataReq ¶
type CommentStructReq ¶
type CommentTokenReq ¶
type IDTokenReq ¶
type PostStruct ¶
type PostStructEditReq ¶
type PostStructReq ¶
type TextSearchReq ¶
type TextSearchReq struct {
Text string `form:"text" binding:"required"`
}
Click to show internal directories.
Click to hide internal directories.