Openapi

package
v0.0.0-...-3b33557 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

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

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

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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

Types

type ChiServerOptions

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

type Error

type Error struct {
	Code    ErrorCode `json:"code"`
	Message string    `json:"message"`
}

エラーモデル

type ErrorCode

type ErrorCode int

ErrorCode defines model for Error.Code.

const (
	ErrorCodeN400 ErrorCode = 400

	ErrorCodeN404 ErrorCode = 404

	ErrorCodeN500 ErrorCode = 500

	ErrorCodeN503 ErrorCode = 503
)

Defines values for ErrorCode.

type Member

type Member struct {
	CvUrl          string `json:"cvUrl"`
	GithubPicture  string `json:"githubPicture"`
	GithubUserName string `json:"githubUserName"`
	Id             int64  `json:"id"`
}

メンバーモデル

type MiddlewareFunc

type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc

type ServerInterface

type ServerInterface interface {
	// 002 メンバー一覧参照
	// (GET /members)
	GetMembers(w http.ResponseWriter, r *http.Request)
	// 001 メンバー参照
	// (GET /members/{id})
	GetMemberById(w http.ResponseWriter, r *http.Request, id int)
	// 003 Webサービス一覧参照
	// (GET /webservices)
	GetWebservices(w http.ResponseWriter, r *http.Request)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) GetMemberById

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

GetMemberById operation middleware

func (*ServerInterfaceWrapper) GetMembers

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

GetMembers operation middleware

func (*ServerInterfaceWrapper) GetWebservices

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

GetWebservices operation middleware

type WebService

type WebService struct {
	Description string `json:"description"`
	Id          int64  `json:"id"`
	Url         string `json:"url"`
}

WebService defines model for WebService.

Jump to

Keyboard shortcuts

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