Documentation
¶
Overview ¶
pkg/api/openapi/generate.go
Package openapi 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 RegisterHandlers(router gin.IRouter, si ServerInterface)
- func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)
- type CreateUser201JSONResponse
- type CreateUser400JSONResponse
- type CreateUser413JSONResponse
- type CreateUser500JSONResponse
- type CreateUserJSONRequestBody
- type CreateUserRequestObject
- type CreateUserResponseObject
- type DeleteUserById204Response
- type DeleteUserById404JSONResponse
- type DeleteUserById500JSONResponse
- type DeleteUserByIdRequestObject
- type DeleteUserByIdResponseObject
- type GetHealthLiveness200JSONResponse
- type GetHealthLiveness503JSONResponse
- type GetHealthLivenessRequestObject
- type GetHealthLivenessResponseObject
- type GetHealthReadiness200JSONResponse
- type GetHealthReadiness503JSONResponse
- type GetHealthReadinessRequestObject
- type GetHealthReadinessResponseObject
- type GetUserById200JSONResponse
- type GetUserById404JSONResponse
- type GetUserById500JSONResponse
- type GetUserByIdRequestObject
- type GetUserByIdResponseObject
- type GinServerOptions
- type HealthStatus
- type HealthStatusStatus
- type InvalidParam
- type ListUsers200JSONResponse
- type ListUsers500JSONResponse
- type ListUsersRequestObject
- type ListUsersResponseObject
- type MiddlewareFunc
- type ProblemDetails
- type ProblemDetailsBase
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CreateUser(c *gin.Context)
- func (siw *ServerInterfaceWrapper) DeleteUserById(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetHealthLiveness(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetHealthReadiness(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetUserById(c *gin.Context)
- func (siw *ServerInterfaceWrapper) ListUsers(c *gin.Context)
- func (siw *ServerInterfaceWrapper) UpdateUserById(c *gin.Context)
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type UpdateUserById200JSONResponse
- type UpdateUserById400JSONResponse
- type UpdateUserById404JSONResponse
- type UpdateUserById413JSONResponse
- type UpdateUserById500JSONResponse
- type UpdateUserByIdJSONRequestBody
- type UpdateUserByIdRequestObject
- type UpdateUserByIdResponseObject
- type User
- type UserPrototype
- type UserPrototypeOptional
- type UserResponse
- type UsersListResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(router gin.IRouter, si ServerInterface)
RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
func RegisterHandlersWithOptions ¶
func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)
RegisterHandlersWithOptions creates http.Handler with additional options
Types ¶
type CreateUser201JSONResponse ¶
type CreateUser201JSONResponse UserResponse
func (CreateUser201JSONResponse) VisitCreateUserResponse ¶
func (response CreateUser201JSONResponse) VisitCreateUserResponse(w http.ResponseWriter) error
type CreateUser400JSONResponse ¶
type CreateUser400JSONResponse ProblemDetails
func (CreateUser400JSONResponse) VisitCreateUserResponse ¶
func (response CreateUser400JSONResponse) VisitCreateUserResponse(w http.ResponseWriter) error
type CreateUser413JSONResponse ¶
type CreateUser413JSONResponse ProblemDetails
func (CreateUser413JSONResponse) VisitCreateUserResponse ¶
func (response CreateUser413JSONResponse) VisitCreateUserResponse(w http.ResponseWriter) error
type CreateUser500JSONResponse ¶
type CreateUser500JSONResponse ProblemDetails
func (CreateUser500JSONResponse) VisitCreateUserResponse ¶
func (response CreateUser500JSONResponse) VisitCreateUserResponse(w http.ResponseWriter) error
type CreateUserJSONRequestBody ¶
type CreateUserJSONRequestBody = UserPrototype
CreateUserJSONRequestBody defines body for CreateUser for application/json ContentType.
type CreateUserRequestObject ¶
type CreateUserRequestObject struct {
Body *CreateUserJSONRequestBody
}
type CreateUserResponseObject ¶
type CreateUserResponseObject interface {
VisitCreateUserResponse(w http.ResponseWriter) error
}
type DeleteUserById204Response ¶
type DeleteUserById204Response struct {
}
func (DeleteUserById204Response) VisitDeleteUserByIdResponse ¶
func (response DeleteUserById204Response) VisitDeleteUserByIdResponse(w http.ResponseWriter) error
type DeleteUserById404JSONResponse ¶
type DeleteUserById404JSONResponse ProblemDetails
func (DeleteUserById404JSONResponse) VisitDeleteUserByIdResponse ¶
func (response DeleteUserById404JSONResponse) VisitDeleteUserByIdResponse(w http.ResponseWriter) error
type DeleteUserById500JSONResponse ¶
type DeleteUserById500JSONResponse ProblemDetails
func (DeleteUserById500JSONResponse) VisitDeleteUserByIdResponse ¶
func (response DeleteUserById500JSONResponse) VisitDeleteUserByIdResponse(w http.ResponseWriter) error
type DeleteUserByIdRequestObject ¶
type DeleteUserByIdRequestObject struct {
UserId string `json:"user_id"`
}
type DeleteUserByIdResponseObject ¶
type DeleteUserByIdResponseObject interface {
VisitDeleteUserByIdResponse(w http.ResponseWriter) error
}
type GetHealthLiveness200JSONResponse ¶
type GetHealthLiveness200JSONResponse HealthStatus
func (GetHealthLiveness200JSONResponse) VisitGetHealthLivenessResponse ¶
func (response GetHealthLiveness200JSONResponse) VisitGetHealthLivenessResponse(w http.ResponseWriter) error
type GetHealthLiveness503JSONResponse ¶
type GetHealthLiveness503JSONResponse HealthStatus
func (GetHealthLiveness503JSONResponse) VisitGetHealthLivenessResponse ¶
func (response GetHealthLiveness503JSONResponse) VisitGetHealthLivenessResponse(w http.ResponseWriter) error
type GetHealthLivenessRequestObject ¶
type GetHealthLivenessRequestObject struct {
}
type GetHealthLivenessResponseObject ¶
type GetHealthLivenessResponseObject interface {
VisitGetHealthLivenessResponse(w http.ResponseWriter) error
}
type GetHealthReadiness200JSONResponse ¶
type GetHealthReadiness200JSONResponse HealthStatus
func (GetHealthReadiness200JSONResponse) VisitGetHealthReadinessResponse ¶
func (response GetHealthReadiness200JSONResponse) VisitGetHealthReadinessResponse(w http.ResponseWriter) error
type GetHealthReadiness503JSONResponse ¶
type GetHealthReadiness503JSONResponse HealthStatus
func (GetHealthReadiness503JSONResponse) VisitGetHealthReadinessResponse ¶
func (response GetHealthReadiness503JSONResponse) VisitGetHealthReadinessResponse(w http.ResponseWriter) error
type GetHealthReadinessRequestObject ¶
type GetHealthReadinessRequestObject struct {
}
type GetHealthReadinessResponseObject ¶
type GetHealthReadinessResponseObject interface {
VisitGetHealthReadinessResponse(w http.ResponseWriter) error
}
type GetUserById200JSONResponse ¶
type GetUserById200JSONResponse UserResponse
func (GetUserById200JSONResponse) VisitGetUserByIdResponse ¶
func (response GetUserById200JSONResponse) VisitGetUserByIdResponse(w http.ResponseWriter) error
type GetUserById404JSONResponse ¶
type GetUserById404JSONResponse ProblemDetails
func (GetUserById404JSONResponse) VisitGetUserByIdResponse ¶
func (response GetUserById404JSONResponse) VisitGetUserByIdResponse(w http.ResponseWriter) error
type GetUserById500JSONResponse ¶
type GetUserById500JSONResponse ProblemDetails
func (GetUserById500JSONResponse) VisitGetUserByIdResponse ¶
func (response GetUserById500JSONResponse) VisitGetUserByIdResponse(w http.ResponseWriter) error
type GetUserByIdRequestObject ¶
type GetUserByIdRequestObject struct {
UserId string `json:"user_id"`
}
type GetUserByIdResponseObject ¶
type GetUserByIdResponseObject interface {
VisitGetUserByIdResponse(w http.ResponseWriter) error
}
type GinServerOptions ¶
type GinServerOptions struct {
BaseURL string
Middlewares []MiddlewareFunc
ErrorHandler func(*gin.Context, error, int)
}
GinServerOptions provides options for the Gin server.
type HealthStatus ¶
type HealthStatus struct {
// Status システムの状態
Status HealthStatusStatus `json:"status"`
}
HealthStatus defines model for HealthStatus.
type HealthStatusStatus ¶
type HealthStatusStatus string
HealthStatusStatus システムの状態
const ( Available HealthStatusStatus = "available" )
Defines values for HealthStatusStatus.
type InvalidParam ¶
type InvalidParam struct {
// Name The name of the invalid field (in JSON).
Name string `json:"name"`
// Reason The reason why the field is invalid.
Reason string `json:"reason"`
}
InvalidParam A single invalid parameter and its validation reason.
type ListUsers200JSONResponse ¶
type ListUsers200JSONResponse UsersListResponse
func (ListUsers200JSONResponse) VisitListUsersResponse ¶
func (response ListUsers200JSONResponse) VisitListUsersResponse(w http.ResponseWriter) error
type ListUsers500JSONResponse ¶
type ListUsers500JSONResponse ProblemDetails
func (ListUsers500JSONResponse) VisitListUsersResponse ¶
func (response ListUsers500JSONResponse) VisitListUsersResponse(w http.ResponseWriter) error
type ListUsersRequestObject ¶
type ListUsersRequestObject struct {
}
type ListUsersResponseObject ¶
type ListUsersResponseObject interface {
VisitListUsersResponse(w http.ResponseWriter) error
}
type MiddlewareFunc ¶
type ProblemDetails ¶
type ProblemDetails struct {
Detail *string `json:"detail,omitempty"`
ErrorCode *string `json:"error_code,omitempty"`
Instance *string `json:"instance,omitempty"`
InvalidParams *[]InvalidParam `json:"invalid_params,omitempty"`
Status *int32 `json:"status,omitempty"`
Title *string `json:"title,omitempty"`
TraceId *string `json:"trace_id,omitempty"`
Type *string `json:"type,omitempty"`
AdditionalProperties map[string]interface{} `json:"-"`
}
ProblemDetails defines model for ProblemDetails.
func (ProblemDetails) Get ¶
func (a ProblemDetails) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for ProblemDetails. Returns the specified element and whether it was found
func (ProblemDetails) MarshalJSON ¶
func (a ProblemDetails) MarshalJSON() ([]byte, error)
Override default JSON handling for ProblemDetails to handle AdditionalProperties
func (*ProblemDetails) Set ¶
func (a *ProblemDetails) Set(fieldName string, value interface{})
Setter for additional properties for ProblemDetails
func (*ProblemDetails) UnmarshalJSON ¶
func (a *ProblemDetails) UnmarshalJSON(b []byte) error
Override default JSON handling for ProblemDetails to handle AdditionalProperties
type ProblemDetailsBase ¶
type ProblemDetailsBase struct {
Detail *string `json:"detail,omitempty"`
Instance *string `json:"instance,omitempty"`
Status *int32 `json:"status,omitempty"`
Title *string `json:"title,omitempty"`
Type *string `json:"type,omitempty"`
AdditionalProperties map[string]interface{} `json:"-"`
}
ProblemDetailsBase Standard RFC7807 Problem Details base object
func (ProblemDetailsBase) Get ¶
func (a ProblemDetailsBase) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for ProblemDetailsBase. Returns the specified element and whether it was found
func (ProblemDetailsBase) MarshalJSON ¶
func (a ProblemDetailsBase) MarshalJSON() ([]byte, error)
Override default JSON handling for ProblemDetailsBase to handle AdditionalProperties
func (*ProblemDetailsBase) Set ¶
func (a *ProblemDetailsBase) Set(fieldName string, value interface{})
Setter for additional properties for ProblemDetailsBase
func (*ProblemDetailsBase) UnmarshalJSON ¶
func (a *ProblemDetailsBase) UnmarshalJSON(b []byte) error
Override default JSON handling for ProblemDetailsBase to handle AdditionalProperties
type ServerInterface ¶
type ServerInterface interface {
// Liveness チェック
// (GET /health/liveness)
GetHealthLiveness(c *gin.Context)
// Readiness チェック
// (GET /health/readiness)
GetHealthReadiness(c *gin.Context)
// List all users
// (GET /users)
ListUsers(c *gin.Context)
// Create a new user
// (POST /users)
CreateUser(c *gin.Context)
// Delete a user by ID
// (DELETE /users/{user_id})
DeleteUserById(c *gin.Context, userId string)
// Get a user by ID
// (GET /users/{user_id})
GetUserById(c *gin.Context, userId string)
// Update a user by ID
// (PATCH /users/{user_id})
UpdateUserById(c *gin.Context, userId string)
}
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandler func(*gin.Context, error, int)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) CreateUser ¶
func (siw *ServerInterfaceWrapper) CreateUser(c *gin.Context)
CreateUser operation middleware
func (*ServerInterfaceWrapper) DeleteUserById ¶
func (siw *ServerInterfaceWrapper) DeleteUserById(c *gin.Context)
DeleteUserById operation middleware
func (*ServerInterfaceWrapper) GetHealthLiveness ¶
func (siw *ServerInterfaceWrapper) GetHealthLiveness(c *gin.Context)
GetHealthLiveness operation middleware
func (*ServerInterfaceWrapper) GetHealthReadiness ¶
func (siw *ServerInterfaceWrapper) GetHealthReadiness(c *gin.Context)
GetHealthReadiness operation middleware
func (*ServerInterfaceWrapper) GetUserById ¶
func (siw *ServerInterfaceWrapper) GetUserById(c *gin.Context)
GetUserById operation middleware
func (*ServerInterfaceWrapper) ListUsers ¶
func (siw *ServerInterfaceWrapper) ListUsers(c *gin.Context)
ListUsers operation middleware
func (*ServerInterfaceWrapper) UpdateUserById ¶
func (siw *ServerInterfaceWrapper) UpdateUserById(c *gin.Context)
UpdateUserById operation middleware
type StrictHandlerFunc ¶
type StrictHandlerFunc = strictgin.StrictGinHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = strictgin.StrictGinMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// Liveness チェック
// (GET /health/liveness)
GetHealthLiveness(ctx context.Context, request GetHealthLivenessRequestObject) (GetHealthLivenessResponseObject, error)
// Readiness チェック
// (GET /health/readiness)
GetHealthReadiness(ctx context.Context, request GetHealthReadinessRequestObject) (GetHealthReadinessResponseObject, error)
// List all users
// (GET /users)
ListUsers(ctx context.Context, request ListUsersRequestObject) (ListUsersResponseObject, error)
// Create a new user
// (POST /users)
CreateUser(ctx context.Context, request CreateUserRequestObject) (CreateUserResponseObject, error)
// Delete a user by ID
// (DELETE /users/{user_id})
DeleteUserById(ctx context.Context, request DeleteUserByIdRequestObject) (DeleteUserByIdResponseObject, error)
// Get a user by ID
// (GET /users/{user_id})
GetUserById(ctx context.Context, request GetUserByIdRequestObject) (GetUserByIdResponseObject, error)
// Update a user by ID
// (PATCH /users/{user_id})
UpdateUserById(ctx context.Context, request UpdateUserByIdRequestObject) (UpdateUserByIdResponseObject, error)
}
StrictServerInterface represents all server handlers.
type UpdateUserById200JSONResponse ¶
type UpdateUserById200JSONResponse UserResponse
func (UpdateUserById200JSONResponse) VisitUpdateUserByIdResponse ¶
func (response UpdateUserById200JSONResponse) VisitUpdateUserByIdResponse(w http.ResponseWriter) error
type UpdateUserById400JSONResponse ¶
type UpdateUserById400JSONResponse ProblemDetails
func (UpdateUserById400JSONResponse) VisitUpdateUserByIdResponse ¶
func (response UpdateUserById400JSONResponse) VisitUpdateUserByIdResponse(w http.ResponseWriter) error
type UpdateUserById404JSONResponse ¶
type UpdateUserById404JSONResponse ProblemDetails
func (UpdateUserById404JSONResponse) VisitUpdateUserByIdResponse ¶
func (response UpdateUserById404JSONResponse) VisitUpdateUserByIdResponse(w http.ResponseWriter) error
type UpdateUserById413JSONResponse ¶
type UpdateUserById413JSONResponse ProblemDetails
func (UpdateUserById413JSONResponse) VisitUpdateUserByIdResponse ¶
func (response UpdateUserById413JSONResponse) VisitUpdateUserByIdResponse(w http.ResponseWriter) error
type UpdateUserById500JSONResponse ¶
type UpdateUserById500JSONResponse ProblemDetails
func (UpdateUserById500JSONResponse) VisitUpdateUserByIdResponse ¶
func (response UpdateUserById500JSONResponse) VisitUpdateUserByIdResponse(w http.ResponseWriter) error
type UpdateUserByIdJSONRequestBody ¶
type UpdateUserByIdJSONRequestBody = UserPrototypeOptional
UpdateUserByIdJSONRequestBody defines body for UpdateUserById for application/json ContentType.
type UpdateUserByIdRequestObject ¶
type UpdateUserByIdRequestObject struct {
UserId string `json:"user_id"`
Body *UpdateUserByIdJSONRequestBody
}
type UpdateUserByIdResponseObject ¶
type UpdateUserByIdResponseObject interface {
VisitUpdateUserByIdResponse(w http.ResponseWriter) error
}
type User ¶
type User struct {
// Email Email address of the user
Email string `json:"email"`
// Id Unique identifier for the user (UUIDv7)
Id uuid.UUID `json:"id"`
// Name Full name of the user
Name string `json:"name"`
}
User Representation of a user
type UserPrototype ¶
type UserPrototype struct {
// Email Email address of the user
Email string `binding:"required,email" json:"email"`
// Name Full name of the user
Name string `binding:"required" json:"name"`
}
UserPrototype Prototype schema for user create
type UserPrototypeOptional ¶
type UserPrototypeOptional struct {
// Email Email address of the user
Email *string `binding:"required,email" json:"email,omitempty"`
// Name Full name of the user
Name *string `binding:"required" json:"name,omitempty"`
}
UserPrototypeOptional Prototype schema for user update
type UserResponse ¶
type UserResponse struct {
// User Representation of a user
User User `json:"user"`
}
UserResponse Single user response
type UsersListResponse ¶
type UsersListResponse struct {
Users []User `json:"users"`
}
UsersListResponse Users list response