oapi

package
v0.0.0-...-6c69d68 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package oapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.8.1 DO NOT EDIT.

Package oapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.8.1 DO NOT EDIT.

Package oapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.8.1 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL     string
	BaseRouter  chi.Router
	Middlewares []MiddlewareFunc
}

type GetHomeJSONBody

type GetHomeJSONBody Labs

GetHomeJSONBody defines parameters for GetHome.

type GetHomeJSONRequestBody

type GetHomeJSONRequestBody GetHomeJSONBody

GetHomeJSONRequestBody defines body for GetHome for application/json ContentType.

type Graduate

type Graduate bool

Graduate defines model for graduate.

type Labs

type Labs struct {
	Name       *string    `json:"name,omitempty"`
	Professors *Professor `json:"professors,omitempty"`
}

Labs defines model for labs.

type LoginJSONBody

type LoginJSONBody User

LoginJSONBody defines parameters for Login.

type LoginJSONRequestBody

type LoginJSONRequestBody LoginJSONBody

LoginJSONRequestBody defines body for Login for application/json ContentType.

type LogoutParams

type LogoutParams struct {

	// jwtの情報を入れる
	SetCookie *SetCookie `json:"Set-Cookie,omitempty"`
}

LogoutParams defines parameters for Logout.

type MiddlewareFunc

type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc

type OK

type OK interface{}

OK defines model for OK.

type PostGraduateFixJSONBody

type PostGraduateFixJSONBody Graduate

PostGraduateFixJSONBody defines parameters for PostGraduateFix.

type PostGraduateFixJSONRequestBody

type PostGraduateFixJSONRequestBody PostGraduateFixJSONBody

PostGraduateFixJSONRequestBody defines body for PostGraduateFix for application/json ContentType.

type PostGraduateFixParams

type PostGraduateFixParams struct {

	// jwtの情報を入れる
	SetCookie *SetCookie `json:"Set-Cookie,omitempty"`
}

PostGraduateFixParams defines parameters for PostGraduateFix.

type PostGraduateSaveJSONBody

type PostGraduateSaveJSONBody Graduate

PostGraduateSaveJSONBody defines parameters for PostGraduateSave.

type PostGraduateSaveJSONRequestBody

type PostGraduateSaveJSONRequestBody PostGraduateSaveJSONBody

PostGraduateSaveJSONRequestBody defines body for PostGraduateSave for application/json ContentType.

type PostGraduateSaveParams

type PostGraduateSaveParams struct {

	// jwtの情報を入れる
	SetCookie *SetCookie `json:"Set-Cookie,omitempty"`
}

PostGraduateSaveParams defines parameters for PostGraduateSave.

type PostLabFixJSONBody

type PostLabFixJSONBody Labs

PostLabFixJSONBody defines parameters for PostLabFix.

type PostLabFixJSONRequestBody

type PostLabFixJSONRequestBody PostLabFixJSONBody

PostLabFixJSONRequestBody defines body for PostLabFix for application/json ContentType.

type PostLabFixParams

type PostLabFixParams struct {

	// jwtの情報を入れる
	SetCookie *SetCookie `json:"Set-Cookie,omitempty"`
}

PostLabFixParams defines parameters for PostLabFix.

type PostLabSaveJSONBody

type PostLabSaveJSONBody Labs

PostLabSaveJSONBody defines parameters for PostLabSave.

type PostLabSaveJSONRequestBody

type PostLabSaveJSONRequestBody PostLabSaveJSONBody

PostLabSaveJSONRequestBody defines body for PostLabSave for application/json ContentType.

type PostLabSaveParams

type PostLabSaveParams struct {

	// jwtの情報を入れる
	SetCookie *SetCookie `json:"Set-Cookie,omitempty"`
}

PostLabSaveParams defines parameters for PostLabSave.

type Professor

type Professor struct {
	Name  *string `json:"name,omitempty"`
	Point *int    `json:"point,omitempty"`
}

Professor defines model for professor.

type ServerInterface

type ServerInterface interface {
	// 進学情報の修正
	// (PATCH /graduate/{userId}/fix)
	PostGraduateFix(w http.ResponseWriter, r *http.Request, userId UserId, params PostGraduateFixParams)
	// 進学情報の保存
	// (POST /graduate/{userId}/save)
	PostGraduateSave(w http.ResponseWriter, r *http.Request, userId UserId, params PostGraduateSaveParams)
	// Your GET endpoint
	// (GET /home)
	GetHome(w http.ResponseWriter, r *http.Request)
	// 研究室調査結果の修正
	// (PATCH /lab/{userId}/fix)
	PostLabFix(w http.ResponseWriter, r *http.Request, userId UserId, params PostLabFixParams)
	// 研究室調査結果の保存
	// (POST /lab/{userId}/save)
	PostLabSave(w http.ResponseWriter, r *http.Request, userId UserId, params PostLabSaveParams)
	// ログイン
	// (POST /login)
	Login(w http.ResponseWriter, r *http.Request)
	// ログアウト
	// (GET /logout)
	Logout(w http.ResponseWriter, r *http.Request, params LogoutParams)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) GetHome

GetHome operation middleware

func (*ServerInterfaceWrapper) Login

Login operation middleware

func (*ServerInterfaceWrapper) Logout

Logout operation middleware

func (*ServerInterfaceWrapper) PostGraduateFix

func (siw *ServerInterfaceWrapper) PostGraduateFix(w http.ResponseWriter, r *http.Request)

PostGraduateFix operation middleware

func (*ServerInterfaceWrapper) PostGraduateSave

func (siw *ServerInterfaceWrapper) PostGraduateSave(w http.ResponseWriter, r *http.Request)

PostGraduateSave operation middleware

func (*ServerInterfaceWrapper) PostLabFix

func (siw *ServerInterfaceWrapper) PostLabFix(w http.ResponseWriter, r *http.Request)

PostLabFix operation middleware

func (*ServerInterfaceWrapper) PostLabSave

func (siw *ServerInterfaceWrapper) PostLabSave(w http.ResponseWriter, r *http.Request)

PostLabSave operation middleware

type SetCookie

type SetCookie string

SetCookie defines model for Set-Cookie.

type User

type User struct {
	Password *string `json:"password,omitempty"`
	UserId   *string `json:"user_id,omitempty"`
}

ログイン情報

type UserId

type UserId string

UserId defines model for userId.

Jump to

Keyboard shortcuts

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