APIGO

package
v0.0.0-...-c6e290e Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

README

Go API Server for

This is a simple blog server.

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-08T18:41:32.936+08:00
Running the server

To run the server, follow these simple steps:

go run main.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUser

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

curl localhost:8080/v1/user -X POST -d 'username=12312312&email=123&password=123&phone=23&userStatus=123'

func DeleteUser

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

curl localhost:8080/v1/user/123123123 -i

func GetColumnByName

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

func GetReviewByNameAndID

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

func GetUserArticleByName

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

func GetUserArticleByNameAndID

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

func GetUserByName

func GetUserByName(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 LoginUser

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

curl localhost:8080/v1/user/login\?username=12312312\&password=123 -i

func LogoutUser

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

func NewRouter

func NewRouter() *mux.Router

func UpdateUser

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

curl -i localhost:8080/v1/user/12312312 -X PUT -d 'username=12312312&email=123&password=1234&phone=23&userStatus=123'

Types

type Article

type Article struct {
	ID      string `json:"ID"`
	Title   string `json:"title"`
	Author  string `json:"author"`
	Content string `json:"content"`
}

type Articles

type Articles struct {
	AllArticles []Article `json:"AllArticles"`
}

type Columns

type Columns struct {
	AllColumns []string `json:"AllColumns"`
}

type DBColumn

type DBColumn struct {
	Columns []SubColumn `json:"Columns"`
}

type DBReview

type DBReview struct {
	Reviews []SubReview `json:"reviews"`
}

type Reviews

type Reviews struct {
	AllReviews []string `json:"AllReviews"`
}

type Route

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

type Routes

type Routes []Route

type SubColumn

type SubColumn struct {
	Username string `json:"username"`
	Column   string `json:"column"`
}

type SubReview

type SubReview struct {
	Username string `json:"username"`
	ID       string `json:"id"`
	Comment  string `json:"comment"`
}

type User

type User struct {
	Username   string `json:"username"`
	Email      string `json:"email"`
	Password   string `json:"password"`
	Phone      string `json:"phone"`
	UserStatus string `json:"userStatus"`
}

json tag struct []byte capital

Jump to

Keyboard shortcuts

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