Documentation
¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type ContentID
- type ContentName
- type ContentRequest
- type ContentResponse
- type EchoRouter
- type ErrorMessage
- type GetContents200JSONResponse
- type GetContents500JSONResponse
- type GetContentsByID200JSONResponse
- type GetContentsByID400JSONResponse
- type GetContentsByID404JSONResponse
- type GetContentsByID500JSONResponse
- type GetContentsByIDRequestObject
- type GetContentsByIDResponseObject
- type GetContentsRequestObject
- type GetContentsResponseObject
- type ID
- type InquiryID
- type N400BadRequest
- type N404NotFound
- type N500InternalServerError
- type PostContents201JSONResponse
- type PostContents400JSONResponse
- type PostContents500JSONResponse
- type PostContentsJSONRequestBody
- type PostContentsRequestObject
- type PostContentsResponseObject
- type ProgramAnswer
- type ProgramID
- type ProgramQuestion
- type ProgramRequest
- type ProgramResponse
- type ServerInterface
- type ServerInterfaceWrapper
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
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 PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func RegisterHandlers ¶
func RegisterHandlers(router EchoRouter, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlersWithBaseURL ¶
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
Types ¶
type ContentRequest ¶
type ContentRequest struct {
// Name コンテンツ名
Name ContentName `json:"name"`
Programs []ProgramRequest `json:"programs"`
}
ContentRequest defines model for ContentRequest.
type ContentResponse ¶
type ContentResponse struct {
// ContentID コンテンツを一意に識別するID(フォーマットはUUID v7)
ContentID ContentID `json:"id"`
// Name コンテンツ名
Name ContentName `json:"name"`
Programs []ProgramResponse `json:"programs"`
}
ContentResponse defines model for ContentResponse.
type EchoRouter ¶
type EchoRouter interface {
CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}
This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration
type GetContents200JSONResponse ¶
type GetContents200JSONResponse []ContentResponse
func (GetContents200JSONResponse) VisitGetContentsResponse ¶
func (response GetContents200JSONResponse) VisitGetContentsResponse(w http.ResponseWriter) error
type GetContents500JSONResponse ¶
type GetContents500JSONResponse N500InternalServerError
func (GetContents500JSONResponse) VisitGetContentsResponse ¶
func (response GetContents500JSONResponse) VisitGetContentsResponse(w http.ResponseWriter) error
type GetContentsByID200JSONResponse ¶
type GetContentsByID200JSONResponse ContentResponse
func (GetContentsByID200JSONResponse) VisitGetContentsByIDResponse ¶
func (response GetContentsByID200JSONResponse) VisitGetContentsByIDResponse(w http.ResponseWriter) error
type GetContentsByID400JSONResponse ¶
type GetContentsByID400JSONResponse N400BadRequest
func (GetContentsByID400JSONResponse) VisitGetContentsByIDResponse ¶
func (response GetContentsByID400JSONResponse) VisitGetContentsByIDResponse(w http.ResponseWriter) error
type GetContentsByID404JSONResponse ¶
type GetContentsByID404JSONResponse N404NotFound
func (GetContentsByID404JSONResponse) VisitGetContentsByIDResponse ¶
func (response GetContentsByID404JSONResponse) VisitGetContentsByIDResponse(w http.ResponseWriter) error
type GetContentsByID500JSONResponse ¶
type GetContentsByID500JSONResponse N500InternalServerError
func (GetContentsByID500JSONResponse) VisitGetContentsByIDResponse ¶
func (response GetContentsByID500JSONResponse) VisitGetContentsByIDResponse(w http.ResponseWriter) error
type GetContentsByIDRequestObject ¶
type GetContentsByIDRequestObject struct {
ID ID `json:"id"`
}
type GetContentsByIDResponseObject ¶
type GetContentsByIDResponseObject interface {
VisitGetContentsByIDResponse(w http.ResponseWriter) error
}
type GetContentsRequestObject ¶
type GetContentsRequestObject struct {
}
type GetContentsResponseObject ¶
type GetContentsResponseObject interface {
VisitGetContentsResponse(w http.ResponseWriter) error
}
type N400BadRequest ¶
type N400BadRequest struct {
// Message エラーメッセージ
Message ErrorMessage `json:"message"`
}
N400BadRequest defines model for 400-BadRequest.
type N404NotFound ¶
type N404NotFound struct {
// Message エラーメッセージ
Message *ErrorMessage `json:"message,omitempty"`
}
N404NotFound defines model for 404-NotFound.
type N500InternalServerError ¶
type N500InternalServerError struct {
// InquiryID 問い合わせ用ID
InquiryID InquiryID `json:"inquiryId"`
// Message エラーメッセージ
Message ErrorMessage `json:"message"`
}
N500InternalServerError defines model for 500-InternalServerError.
type PostContents201JSONResponse ¶
type PostContents201JSONResponse ContentResponse
func (PostContents201JSONResponse) VisitPostContentsResponse ¶
func (response PostContents201JSONResponse) VisitPostContentsResponse(w http.ResponseWriter) error
type PostContents400JSONResponse ¶
type PostContents400JSONResponse N400BadRequest
func (PostContents400JSONResponse) VisitPostContentsResponse ¶
func (response PostContents400JSONResponse) VisitPostContentsResponse(w http.ResponseWriter) error
type PostContents500JSONResponse ¶
type PostContents500JSONResponse N500InternalServerError
func (PostContents500JSONResponse) VisitPostContentsResponse ¶
func (response PostContents500JSONResponse) VisitPostContentsResponse(w http.ResponseWriter) error
type PostContentsJSONRequestBody ¶
type PostContentsJSONRequestBody = ContentRequest
PostContentsJSONRequestBody defines body for PostContents for application/json ContentType.
type PostContentsRequestObject ¶
type PostContentsRequestObject struct {
Body *PostContentsJSONRequestBody
}
type PostContentsResponseObject ¶
type PostContentsResponseObject interface {
VisitPostContentsResponse(w http.ResponseWriter) error
}
type ProgramRequest ¶
type ProgramRequest struct {
// Answer 解答
Answer ProgramAnswer `json:"answer"`
// Question 問題
Question ProgramQuestion `json:"question"`
}
ProgramRequest defines model for ProgramRequest.
type ProgramResponse ¶
type ProgramResponse struct {
// Answer 解答
Answer *ProgramAnswer `json:"answer,omitempty"`
// ProgramID 問題を一意に識別するID(フォーマットはUUID v7)
ProgramID ProgramID `json:"id"`
// Question 問題
Question *ProgramQuestion `json:"question,omitempty"`
}
ProgramResponse defines model for ProgramResponse.
type ServerInterface ¶
type ServerInterface interface {
// コンテンツ一覧取得
// (GET /contents)
GetContents(ctx echo.Context) error
// コンテンツ新規登録
// (POST /contents)
PostContents(ctx echo.Context) error
// 指定コンテンツ取得
// (GET /contents/{id})
GetContentsByID(ctx echo.Context, id ID) error
}
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) GetContents ¶
func (w *ServerInterfaceWrapper) GetContents(ctx echo.Context) error
GetContents converts echo context to params.
func (*ServerInterfaceWrapper) GetContentsByID ¶
func (w *ServerInterfaceWrapper) GetContentsByID(ctx echo.Context) error
GetContentsByID converts echo context to params.
func (*ServerInterfaceWrapper) PostContents ¶
func (w *ServerInterfaceWrapper) PostContents(ctx echo.Context) error
PostContents converts echo context to params.
type StrictHandlerFunc ¶
type StrictHandlerFunc = strictecho.StrictEchoHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = strictecho.StrictEchoMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// コンテンツ一覧取得
// (GET /contents)
GetContents(ctx context.Context, request GetContentsRequestObject) (GetContentsResponseObject, error)
// コンテンツ新規登録
// (POST /contents)
PostContents(ctx context.Context, request PostContentsRequestObject) (PostContentsResponseObject, error)
// 指定コンテンツ取得
// (GET /contents/{id})
GetContentsByID(ctx context.Context, request GetContentsByIDRequestObject) (GetContentsByIDResponseObject, error)
}
StrictServerInterface represents all server handlers.