Documentation ¶
Index ¶
- Constants
- func ArticleIdCommentPost(w http.ResponseWriter, r *http.Request)
- func ArticleIdCommentsGet(w http.ResponseWriter, r *http.Request)
- func ArticleIdGet(w http.ResponseWriter, r *http.Request)
- func ArticlesGet(w http.ResponseWriter, r *http.Request)
- func Index(w http.ResponseWriter, r *http.Request)
- func Logger(inner http.Handler, name string) http.Handler
- func NewRouter() *mux.Router
- func Options(w http.ResponseWriter, r *http.Request)
- func Response(response interface{}, w http.ResponseWriter, code int)
- func SignToken(userName string) (string, error)
- func UserLoginPost(w http.ResponseWriter, r *http.Request)
- func UserRegisterPost(w http.ResponseWriter, r *http.Request)
- func ValidateToken(w http.ResponseWriter, r *http.Request) (*jwt.Token, bool)
- type MyResponse
- type Route
- type Routes
Constants ¶
View Source
const SecretKey = "123qwe"
SecretKey : secret key for jwt
Variables ¶
This section is empty.
Functions ¶
func ArticleIdCommentPost ¶
func ArticleIdCommentPost(w http.ResponseWriter, r *http.Request)
func ArticleIdCommentsGet ¶
func ArticleIdCommentsGet(w http.ResponseWriter, r *http.Request)
func ArticleIdGet ¶
func ArticleIdGet(w http.ResponseWriter, r *http.Request)
func ArticlesGet ¶
func ArticlesGet(w http.ResponseWriter, r *http.Request)
func Response ¶
func Response(response interface{}, w http.ResponseWriter, code int)
func UserLoginPost ¶
func UserLoginPost(w http.ResponseWriter, r *http.Request)
func UserRegisterPost ¶
func UserRegisterPost(w http.ResponseWriter, r *http.Request)
func ValidateToken ¶
func ValidateToken(w http.ResponseWriter, r *http.Request) (*jwt.Token, bool)
Types ¶
type MyResponse ¶
type MyResponse struct { OkMessage interface{} `json:"ok,omitempty"` ErrorMessage interface{} `json:"error,omitempty"` }
Click to show internal directories.
Click to hide internal directories.