openapi

package
v0.0.0-...-02085da Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: MIT Imports: 2 Imported by: 0

README

Go API Server for openapi

test api

Overview

This server was generated by the [openapi-generator] (https://openapi-generator.tech) 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
  • Build date: 2020-08-30T10:51:50.118375+09:00[Asia/Tokyo]
Running the server

To run the server, follow these simple steps:

go run main.go

To run the server in a docker container

docker build --network=host -t openapi .

Once the image is built, just run

docker run --rm -it openapi 
Known Issue

Endpoints sharing a common path may result in issues. For example, /v2/pet/findByTags and /v2/pet/:petId will result in an issue with the Gin framework. For more information about this known limitation, please refer to gin-gonic/gin#388 for more information.

A workaround is to manually update the path and handler. Please refer to gin-gonic/gin/issues/205#issuecomment-296155497 for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAuthersId

func DeleteAuthersId(c *gin.Context)

DeleteAuthersId -

func DeleteBooksId

func DeleteBooksId(c *gin.Context)

DeleteBooksId -

func DeleteCategoriesId

func DeleteCategoriesId(c *gin.Context)

DeleteCategoriesId -

func GetAuthers

func GetAuthers(c *gin.Context)

GetAuthers - Your GET endpoint

func GetAuthersId

func GetAuthersId(c *gin.Context)

GetAuthersId - Your GET endpoint

func GetBooks

func GetBooks(c *gin.Context)

GetBooks - Your GET endpoint

func GetBooksId

func GetBooksId(c *gin.Context)

GetBooksId - Your GET endpoint

func GetCategories

func GetCategories(c *gin.Context)

GetCategories - Your GET endpoint

func GetCategoriesId

func GetCategoriesId(c *gin.Context)

GetCategoriesId - Your GET endpoint

func Index

func Index(c *gin.Context)

Index is the index handler.

func NewRouter

func NewRouter() *gin.Engine

NewRouter returns a new router.

func PatchAuthersId

func PatchAuthersId(c *gin.Context)

PatchAuthersId -

func PatchBooksId

func PatchBooksId(c *gin.Context)

PatchBooksId -

func PatchCategoriesId

func PatchCategoriesId(c *gin.Context)

PatchCategoriesId -

func PostAuthers

func PostAuthers(c *gin.Context)

PostAuthers -

func PostBooks

func PostBooks(c *gin.Context)

PostBooks -

func PostCategories

func PostCategories(c *gin.Context)

PostCategories -

Types

type Auther

type Auther struct {
	Id int32 `json:"id,omitempty"`

	Name string `json:"name,omitempty"`
}

type Book

type Book struct {
	Id int32 `json:"id,omitempty"`

	AutherId int32 `json:"auther_id,omitempty"`

	CategoryList []int32 `json:"category_list,omitempty"`
}

type Category

type Category struct {
	Id int32 `json:"id,omitempty"`

	Name string `json:"name,omitempty"`
}

type Result

type Result struct {
	Success bool `json:"success,omitempty"`
}

Result - results

type Route

type Route struct {
	// Name is the name of this Route.
	Name string
	// Method is the string for the HTTP method. ex) GET, POST etc..
	Method string
	// Pattern is the pattern of the URI.
	Pattern string
	// HandlerFunc is the handler function of this route.
	HandlerFunc gin.HandlerFunc
}

Route is the information for every URI.

type Routes

type Routes []Route

Routes is the list of the generated Route.

Jump to

Keyboard shortcuts

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