Back to godoc.org

Package blog

v0.0.0-...-b30913e
Latest Go to latest

The latest major version is .

Published: Mar 24, 2017 | License: MIT | Module: github.com/Vladimir37/Backlun

Index

Variables

var AuthToken string = GenerateToken(12)
var CurrentPostID int = 1
var PostList []PostStruct

func CORSMiddleware

func CORSMiddleware() gin.HandlerFunc

CORSMiddleware middleware headers for any RESTful requests {{{

func CheckToken

func CheckToken(c *gin.Context)

func CreateComment

func CreateComment(c *gin.Context)

func CreatePost

func CreatePost(c *gin.Context)

func DeleteComment

func DeleteComment(c *gin.Context)

func DeletePost

func DeletePost(c *gin.Context)

func EditPost

func EditPost(c *gin.Context)

func GenerateToken

func GenerateToken(strlen int) string

func GetAllPosts

func GetAllPosts(c *gin.Context)

func GetAuthData

func GetAuthData(c *gin.Context)

func GetOnePost

func GetOnePost(c *gin.Context)

func Login

func Login(c *gin.Context)

func Logout

func Logout(c *gin.Context)

func SearchTag

func SearchTag(c *gin.Context)

func SearchText

func SearchText(c *gin.Context)

func Start

func Start(args []string)

type AuthData

type AuthData struct {
	Login    string
	Password string
}
var CurrentAuthData AuthData = AuthData{
	Login:    randomdata.FirstName(randomdata.Female),
	Password: GenerateToken(5),
}

type AuthDataReq

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

type CommentStruct

type CommentStruct struct {
	ID   int
	Name string
	Date time.Time
	Text string
}

type CommentStructReq

type CommentStructReq struct {
	Post int    `form:"post" binding:"required"`
	Name string `form:"name"`
	Text string `form:"text" binding:"required"`
}

type CommentTokenReq

type CommentTokenReq struct {
	Post    int    `form:"post" binding:"required"`
	Comment int    `form:"comment" binding:"required"`
	Token   string `form:"token" binding:"required"`
}

type IDReq

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

type IDTokenReq

type IDTokenReq struct {
	ID    int    `form:"id" binding:"required"`
	Token string `form:"token" binding:"required"`
}

type PostStruct

type PostStruct struct {
	ID               int
	Title            string
	Date             time.Time
	Tags             []string
	Text             string
	CurrentCommentID int
	Comments         []CommentStruct
}

type PostStructEditReq

type PostStructEditReq struct {
	ID    int    `form:"id" binding:"required"`
	Token string `form:"token" binding:"required"`
	Title string `form:"title" binding:"required"`
	Tags  string `form:"tags"`
	Text  string `form:"text" binding:"required"`
}

type PostStructReq

type PostStructReq struct {
	Token string `form:"token" binding:"required"`
	Title string `form:"title" binding:"required"`
	Tags  string `form:"tags"`
	Text  string `form:"text" binding:"required"`
}

type TagReq

type TagReq struct {
	Tag string `form:"tag" binding:"required"`
}

type TextSearchReq

type TextSearchReq struct {
	Text string `form:"text" binding:"required"`
}

type TokenReq

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier