swagger

package
v0.0.0-...-37bbf14 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2019 License: MIT Imports: 14 Imported by: 0

README

Go API Server for swagger

Simple Blog

Overview

This server was generated by the [swagger-codegen] (https://github.com/swagger-api/swagger-codegen) project.
By using the OpenAPI-Spec from a remote server, you can easily generate a server stub.

To see how to make this your own, look here:

README

  • API version: 1.0.0
  • Build date: 2019-12-05T13:29:46.288Z
Running the server

To run the server, follow these simple steps:

go run main.go

Documentation

Index

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 Index

func Index(w http.ResponseWriter, r *http.Request)

func Logger

func Logger(inner http.Handler, name string) http.Handler

func NewRouter

func NewRouter() *mux.Router

func Options

func Options(w http.ResponseWriter, r *http.Request)

func Response

func Response(response interface{}, w http.ResponseWriter, code int)

func SignToken

func SignToken(userName string) (string, error)

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"`
}

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

type Routes

type Routes []Route

Jump to

Keyboard shortcuts

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