Documentation
¶
Overview ¶
Package http 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 ErrorHandlerFunc(w http.ResponseWriter, _ *http.Request, err error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- func RegisterStatic(ctx context.Context, mux *chi.Mux)
- func RequestErrorHandlerFunc(w http.ResponseWriter, _ *http.Request, err error)
- func ResponseErrorHandlerFunc(w http.ResponseWriter, _ *http.Request, err error)
- type ChiServerOptions
- type Comment
- type CreateComment201JSONResponse
- type CreateComment400JSONResponse
- type CreateComment401JSONResponse
- type CreateComment500JSONResponse
- type CreateCommentJSONRequestBody
- type CreateCommentRequestObject
- type CreateCommentResponseObject
- type CreateTopic201JSONResponse
- type CreateTopic400JSONResponse
- type CreateTopic401JSONResponse
- type CreateTopic500JSONResponse
- type CreateTopicJSONRequestBody
- type CreateTopicRequestObject
- type CreateTopicResponseObject
- type DeleteComment204Response
- type DeleteComment400JSONResponse
- type DeleteComment401JSONResponse
- type DeleteComment500JSONResponse
- type DeleteCommentRequestObject
- type DeleteCommentResponseObject
- type DeleteTopic204Response
- type DeleteTopic400JSONResponse
- type DeleteTopic401JSONResponse
- type DeleteTopic500JSONResponse
- type DeleteTopicRequestObject
- type DeleteTopicResponseObject
- type GenericErrorMessage
- type GetComment200JSONResponse
- type GetComment400JSONResponse
- type GetComment401JSONResponse
- type GetComment500JSONResponse
- type GetCommentRequestObject
- type GetCommentResponseObject
- type GetTopic200JSONResponse
- type GetTopic400JSONResponse
- type GetTopic401JSONResponse
- type GetTopic500JSONResponse
- type GetTopicRequestObject
- type GetTopicResponseObject
- type Health
- type HealthCheck200JSONResponse
- type HealthCheck400JSONResponse
- type HealthCheck401JSONResponse
- type HealthCheck500JSONResponse
- type HealthCheckRequestObject
- type HealthCheckResponseObject
- type InvalidParamFormatError
- type ListComments200JSONResponse
- type ListComments400JSONResponse
- type ListComments401JSONResponse
- type ListComments500JSONResponse
- type ListCommentsParams
- type ListCommentsRequestObject
- type ListCommentsResponseObject
- type ListTopics200JSONResponse
- type ListTopics400JSONResponse
- type ListTopics401JSONResponse
- type ListTopics500JSONResponse
- type ListTopicsParams
- type ListTopicsRequestObject
- type ListTopicsResponseObject
- type MiddlewareFunc
- type N400BadRequest
- type N400BadRequestJSONResponse
- type N401Unauthorized
- type N401UnauthorizedJSONResponse
- type N500InternalServerError
- type N500InternalServerErrorJSONResponse
- type NewComment
- type NewTopic
- type PaginatedComments
- type PaginatedTopics
- type RequiredHeaderError
- type RequiredParamError
- type Server
- func (s Server) CreateComment(ctx context.Context, request CreateCommentRequestObject) (CreateCommentResponseObject, error)
- func (s Server) CreateTopic(ctx context.Context, request CreateTopicRequestObject) (CreateTopicResponseObject, error)
- func (s Server) DeleteComment(ctx context.Context, request DeleteCommentRequestObject) (DeleteCommentResponseObject, error)
- func (s Server) DeleteTopic(ctx context.Context, request DeleteTopicRequestObject) (DeleteTopicResponseObject, error)
- func (s Server) GetComment(ctx context.Context, request GetCommentRequestObject) (GetCommentResponseObject, error)
- func (s Server) GetTopic(ctx context.Context, request GetTopicRequestObject) (GetTopicResponseObject, error)
- func (s Server) HealthCheck(ctx context.Context, request HealthCheckRequestObject) (HealthCheckResponseObject, error)
- func (s Server) ListComments(ctx context.Context, request ListCommentsRequestObject) (ListCommentsResponseObject, error)
- func (s Server) ListTopics(ctx context.Context, request ListTopicsRequestObject) (ListTopicsResponseObject, error)
- func (s Server) UpdateComment(ctx context.Context, request UpdateCommentRequestObject) (UpdateCommentResponseObject, error)
- func (s Server) UpdateTopic(ctx context.Context, request UpdateTopicRequestObject) (UpdateTopicResponseObject, error)
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CreateComment(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CreateTopic(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteComment(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteTopic(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetComment(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetTopic(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) HealthCheck(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListComments(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListTopics(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) UpdateComment(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) UpdateTopic(w http.ResponseWriter, r *http.Request)
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TooManyValuesForParamError
- type Topic
- type UnescapedCookieParamError
- type Unimplemented
- func (_ Unimplemented) CreateComment(w http.ResponseWriter, r *http.Request, topicId string)
- func (_ Unimplemented) CreateTopic(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) DeleteComment(w http.ResponseWriter, r *http.Request, commentId string)
- func (_ Unimplemented) DeleteTopic(w http.ResponseWriter, r *http.Request, topicId string)
- func (_ Unimplemented) GetComment(w http.ResponseWriter, r *http.Request, commentId string)
- func (_ Unimplemented) GetTopic(w http.ResponseWriter, r *http.Request, topicId string)
- func (_ Unimplemented) HealthCheck(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) ListComments(w http.ResponseWriter, r *http.Request, topicId string, ...)
- func (_ Unimplemented) ListTopics(w http.ResponseWriter, r *http.Request, params ListTopicsParams)
- func (_ Unimplemented) UpdateComment(w http.ResponseWriter, r *http.Request, commentId string)
- func (_ Unimplemented) UpdateTopic(w http.ResponseWriter, r *http.Request, topicId string)
- type UnmarshalingParamError
- type UpdateComment200JSONResponse
- type UpdateComment400JSONResponse
- type UpdateComment401JSONResponse
- type UpdateComment500JSONResponse
- type UpdateCommentJSONRequestBody
- type UpdateCommentRequestObject
- type UpdateCommentResponseObject
- type UpdateTopic200JSONResponse
- type UpdateTopic400JSONResponse
- type UpdateTopic401JSONResponse
- type UpdateTopic500JSONResponse
- type UpdateTopicJSONRequestBody
- type UpdateTopicRequestObject
- type UpdateTopicResponseObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorHandlerFunc ¶
func ErrorHandlerFunc(w http.ResponseWriter, _ *http.Request, err error)
ErrorHandlerFunc is an error adapter for the API. It is used to standardize errors happening in the generated code api handlers
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 HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
func RegisterStatic ¶
RegisterStatic add method to the mux that are not documented in the API.
func RequestErrorHandlerFunc ¶
func RequestErrorHandlerFunc(w http.ResponseWriter, _ *http.Request, err error)
RequestErrorHandlerFunc is a Request Error Handler that can be injected in oapi-codegen to handler errors in requests
func ResponseErrorHandlerFunc ¶
func ResponseErrorHandlerFunc(w http.ResponseWriter, _ *http.Request, err error)
ResponseErrorHandlerFunc is a Response Error Handler that can be injected in oapi-codegen to handler errors in requests We use it to create custom responses to some errors that may occur, like an authentication error.
Types ¶
type ChiServerOptions ¶
type ChiServerOptions struct {
BaseURL string
BaseRouter chi.Router
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type Comment ¶
type Comment struct {
AuthorId string `json:"authorId"`
Content string `json:"content"`
CreatedAt time.Time `json:"createdAt"`
Id string `json:"id"`
ParentCommentId *string `json:"parentCommentId"`
TopicId string `json:"topicId"`
UpdatedAt time.Time `json:"updatedAt"`
}
Comment defines model for Comment.
type CreateComment201JSONResponse ¶
type CreateComment201JSONResponse Comment
func (CreateComment201JSONResponse) VisitCreateCommentResponse ¶
func (response CreateComment201JSONResponse) VisitCreateCommentResponse(w http.ResponseWriter) error
type CreateComment400JSONResponse ¶
type CreateComment400JSONResponse struct{ N400BadRequestJSONResponse }
func (CreateComment400JSONResponse) VisitCreateCommentResponse ¶
func (response CreateComment400JSONResponse) VisitCreateCommentResponse(w http.ResponseWriter) error
type CreateComment401JSONResponse ¶
func (CreateComment401JSONResponse) VisitCreateCommentResponse ¶
func (response CreateComment401JSONResponse) VisitCreateCommentResponse(w http.ResponseWriter) error
type CreateComment500JSONResponse ¶
type CreateComment500JSONResponse struct {
N500InternalServerErrorJSONResponse
}
func (CreateComment500JSONResponse) VisitCreateCommentResponse ¶
func (response CreateComment500JSONResponse) VisitCreateCommentResponse(w http.ResponseWriter) error
type CreateCommentJSONRequestBody ¶
type CreateCommentJSONRequestBody = NewComment
CreateCommentJSONRequestBody defines body for CreateComment for application/json ContentType.
type CreateCommentRequestObject ¶
type CreateCommentRequestObject struct {
TopicId string `json:"topicId"`
Body *CreateCommentJSONRequestBody
}
type CreateCommentResponseObject ¶
type CreateCommentResponseObject interface {
VisitCreateCommentResponse(w http.ResponseWriter) error
}
type CreateTopic201JSONResponse ¶
type CreateTopic201JSONResponse Topic
func (CreateTopic201JSONResponse) VisitCreateTopicResponse ¶
func (response CreateTopic201JSONResponse) VisitCreateTopicResponse(w http.ResponseWriter) error
type CreateTopic400JSONResponse ¶
type CreateTopic400JSONResponse struct{ N400BadRequestJSONResponse }
func (CreateTopic400JSONResponse) VisitCreateTopicResponse ¶
func (response CreateTopic400JSONResponse) VisitCreateTopicResponse(w http.ResponseWriter) error
type CreateTopic401JSONResponse ¶
func (CreateTopic401JSONResponse) VisitCreateTopicResponse ¶
func (response CreateTopic401JSONResponse) VisitCreateTopicResponse(w http.ResponseWriter) error
type CreateTopic500JSONResponse ¶
type CreateTopic500JSONResponse struct {
N500InternalServerErrorJSONResponse
}
func (CreateTopic500JSONResponse) VisitCreateTopicResponse ¶
func (response CreateTopic500JSONResponse) VisitCreateTopicResponse(w http.ResponseWriter) error
type CreateTopicJSONRequestBody ¶
type CreateTopicJSONRequestBody = NewTopic
CreateTopicJSONRequestBody defines body for CreateTopic for application/json ContentType.
type CreateTopicRequestObject ¶
type CreateTopicRequestObject struct {
Body *CreateTopicJSONRequestBody
}
type CreateTopicResponseObject ¶
type CreateTopicResponseObject interface {
VisitCreateTopicResponse(w http.ResponseWriter) error
}
type DeleteComment204Response ¶
type DeleteComment204Response struct {
}
func (DeleteComment204Response) VisitDeleteCommentResponse ¶
func (response DeleteComment204Response) VisitDeleteCommentResponse(w http.ResponseWriter) error
type DeleteComment400JSONResponse ¶
type DeleteComment400JSONResponse struct{ N400BadRequestJSONResponse }
func (DeleteComment400JSONResponse) VisitDeleteCommentResponse ¶
func (response DeleteComment400JSONResponse) VisitDeleteCommentResponse(w http.ResponseWriter) error
type DeleteComment401JSONResponse ¶
func (DeleteComment401JSONResponse) VisitDeleteCommentResponse ¶
func (response DeleteComment401JSONResponse) VisitDeleteCommentResponse(w http.ResponseWriter) error
type DeleteComment500JSONResponse ¶
type DeleteComment500JSONResponse struct {
N500InternalServerErrorJSONResponse
}
func (DeleteComment500JSONResponse) VisitDeleteCommentResponse ¶
func (response DeleteComment500JSONResponse) VisitDeleteCommentResponse(w http.ResponseWriter) error
type DeleteCommentRequestObject ¶
type DeleteCommentRequestObject struct {
CommentId string `json:"commentId"`
}
type DeleteCommentResponseObject ¶
type DeleteCommentResponseObject interface {
VisitDeleteCommentResponse(w http.ResponseWriter) error
}
type DeleteTopic204Response ¶
type DeleteTopic204Response struct {
}
func (DeleteTopic204Response) VisitDeleteTopicResponse ¶
func (response DeleteTopic204Response) VisitDeleteTopicResponse(w http.ResponseWriter) error
type DeleteTopic400JSONResponse ¶
type DeleteTopic400JSONResponse struct{ N400BadRequestJSONResponse }
func (DeleteTopic400JSONResponse) VisitDeleteTopicResponse ¶
func (response DeleteTopic400JSONResponse) VisitDeleteTopicResponse(w http.ResponseWriter) error
type DeleteTopic401JSONResponse ¶
func (DeleteTopic401JSONResponse) VisitDeleteTopicResponse ¶
func (response DeleteTopic401JSONResponse) VisitDeleteTopicResponse(w http.ResponseWriter) error
type DeleteTopic500JSONResponse ¶
type DeleteTopic500JSONResponse struct {
N500InternalServerErrorJSONResponse
}
func (DeleteTopic500JSONResponse) VisitDeleteTopicResponse ¶
func (response DeleteTopic500JSONResponse) VisitDeleteTopicResponse(w http.ResponseWriter) error
type DeleteTopicRequestObject ¶
type DeleteTopicRequestObject struct {
TopicId string `json:"topicId"`
}
type DeleteTopicResponseObject ¶
type DeleteTopicResponseObject interface {
VisitDeleteTopicResponse(w http.ResponseWriter) error
}
type GenericErrorMessage ¶
type GenericErrorMessage struct {
Code int `json:"code"`
Err string `json:"err"`
ErrHuman string `json:"errHuman"`
}
GenericErrorMessage defines model for GenericErrorMessage.
type GetComment200JSONResponse ¶
type GetComment200JSONResponse Comment
func (GetComment200JSONResponse) VisitGetCommentResponse ¶
func (response GetComment200JSONResponse) VisitGetCommentResponse(w http.ResponseWriter) error
type GetComment400JSONResponse ¶
type GetComment400JSONResponse struct{ N400BadRequestJSONResponse }
func (GetComment400JSONResponse) VisitGetCommentResponse ¶
func (response GetComment400JSONResponse) VisitGetCommentResponse(w http.ResponseWriter) error
type GetComment401JSONResponse ¶
func (GetComment401JSONResponse) VisitGetCommentResponse ¶
func (response GetComment401JSONResponse) VisitGetCommentResponse(w http.ResponseWriter) error
type GetComment500JSONResponse ¶
type GetComment500JSONResponse struct {
N500InternalServerErrorJSONResponse
}
func (GetComment500JSONResponse) VisitGetCommentResponse ¶
func (response GetComment500JSONResponse) VisitGetCommentResponse(w http.ResponseWriter) error
type GetCommentRequestObject ¶
type GetCommentRequestObject struct {
CommentId string `json:"commentId"`
}
type GetCommentResponseObject ¶
type GetCommentResponseObject interface {
VisitGetCommentResponse(w http.ResponseWriter) error
}
type GetTopic200JSONResponse ¶
type GetTopic200JSONResponse Topic
func (GetTopic200JSONResponse) VisitGetTopicResponse ¶
func (response GetTopic200JSONResponse) VisitGetTopicResponse(w http.ResponseWriter) error
type GetTopic400JSONResponse ¶
type GetTopic400JSONResponse struct{ N400BadRequestJSONResponse }
func (GetTopic400JSONResponse) VisitGetTopicResponse ¶
func (response GetTopic400JSONResponse) VisitGetTopicResponse(w http.ResponseWriter) error
type GetTopic401JSONResponse ¶
func (GetTopic401JSONResponse) VisitGetTopicResponse ¶
func (response GetTopic401JSONResponse) VisitGetTopicResponse(w http.ResponseWriter) error
type GetTopic500JSONResponse ¶
type GetTopic500JSONResponse struct {
N500InternalServerErrorJSONResponse
}
func (GetTopic500JSONResponse) VisitGetTopicResponse ¶
func (response GetTopic500JSONResponse) VisitGetTopicResponse(w http.ResponseWriter) error
type GetTopicRequestObject ¶
type GetTopicRequestObject struct {
TopicId string `json:"topicId"`
}
type GetTopicResponseObject ¶
type GetTopicResponseObject interface {
VisitGetTopicResponse(w http.ResponseWriter) error
}
type HealthCheck200JSONResponse ¶
type HealthCheck200JSONResponse Health
func (HealthCheck200JSONResponse) VisitHealthCheckResponse ¶
func (response HealthCheck200JSONResponse) VisitHealthCheckResponse(w http.ResponseWriter) error
type HealthCheck400JSONResponse ¶
type HealthCheck400JSONResponse struct{ N400BadRequestJSONResponse }
func (HealthCheck400JSONResponse) VisitHealthCheckResponse ¶
func (response HealthCheck400JSONResponse) VisitHealthCheckResponse(w http.ResponseWriter) error
type HealthCheck401JSONResponse ¶
func (HealthCheck401JSONResponse) VisitHealthCheckResponse ¶
func (response HealthCheck401JSONResponse) VisitHealthCheckResponse(w http.ResponseWriter) error
type HealthCheck500JSONResponse ¶
type HealthCheck500JSONResponse struct {
N500InternalServerErrorJSONResponse
}
func (HealthCheck500JSONResponse) VisitHealthCheckResponse ¶
func (response HealthCheck500JSONResponse) VisitHealthCheckResponse(w http.ResponseWriter) error
type HealthCheckRequestObject ¶
type HealthCheckRequestObject struct {
}
type HealthCheckResponseObject ¶
type HealthCheckResponseObject interface {
VisitHealthCheckResponse(w http.ResponseWriter) error
}
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type ListComments200JSONResponse ¶
type ListComments200JSONResponse PaginatedComments
func (ListComments200JSONResponse) VisitListCommentsResponse ¶
func (response ListComments200JSONResponse) VisitListCommentsResponse(w http.ResponseWriter) error
type ListComments400JSONResponse ¶
type ListComments400JSONResponse struct{ N400BadRequestJSONResponse }
func (ListComments400JSONResponse) VisitListCommentsResponse ¶
func (response ListComments400JSONResponse) VisitListCommentsResponse(w http.ResponseWriter) error
type ListComments401JSONResponse ¶
func (ListComments401JSONResponse) VisitListCommentsResponse ¶
func (response ListComments401JSONResponse) VisitListCommentsResponse(w http.ResponseWriter) error
type ListComments500JSONResponse ¶
type ListComments500JSONResponse struct {
N500InternalServerErrorJSONResponse
}
func (ListComments500JSONResponse) VisitListCommentsResponse ¶
func (response ListComments500JSONResponse) VisitListCommentsResponse(w http.ResponseWriter) error
type ListCommentsParams ¶
type ListCommentsParams struct {
Page *int `form:"page,omitempty" json:"page,omitempty"`
PageSize *int `form:"pageSize,omitempty" json:"pageSize,omitempty"`
}
ListCommentsParams defines parameters for ListComments.
type ListCommentsRequestObject ¶
type ListCommentsRequestObject struct {
TopicId string `json:"topicId"`
Params ListCommentsParams
}
type ListCommentsResponseObject ¶
type ListCommentsResponseObject interface {
VisitListCommentsResponse(w http.ResponseWriter) error
}
type ListTopics200JSONResponse ¶
type ListTopics200JSONResponse PaginatedTopics
func (ListTopics200JSONResponse) VisitListTopicsResponse ¶
func (response ListTopics200JSONResponse) VisitListTopicsResponse(w http.ResponseWriter) error
type ListTopics400JSONResponse ¶
type ListTopics400JSONResponse struct{ N400BadRequestJSONResponse }
func (ListTopics400JSONResponse) VisitListTopicsResponse ¶
func (response ListTopics400JSONResponse) VisitListTopicsResponse(w http.ResponseWriter) error
type ListTopics401JSONResponse ¶
func (ListTopics401JSONResponse) VisitListTopicsResponse ¶
func (response ListTopics401JSONResponse) VisitListTopicsResponse(w http.ResponseWriter) error
type ListTopics500JSONResponse ¶
type ListTopics500JSONResponse struct {
N500InternalServerErrorJSONResponse
}
func (ListTopics500JSONResponse) VisitListTopicsResponse ¶
func (response ListTopics500JSONResponse) VisitListTopicsResponse(w http.ResponseWriter) error
type ListTopicsParams ¶
type ListTopicsParams struct {
Page *int `form:"page,omitempty" json:"page,omitempty"`
PageSize *int `form:"pageSize,omitempty" json:"pageSize,omitempty"`
}
ListTopicsParams defines parameters for ListTopics.
type ListTopicsRequestObject ¶
type ListTopicsRequestObject struct {
Params ListTopicsParams
}
type ListTopicsResponseObject ¶
type ListTopicsResponseObject interface {
VisitListTopicsResponse(w http.ResponseWriter) error
}
type N400BadRequest ¶
type N400BadRequest = GenericErrorMessage
N400BadRequest defines model for 400-BadRequest.
type N400BadRequestJSONResponse ¶
type N400BadRequestJSONResponse GenericErrorMessage
type N401Unauthorized ¶
type N401Unauthorized = GenericErrorMessage
N401Unauthorized defines model for 401-Unauthorized.
type N401UnauthorizedJSONResponse ¶
type N401UnauthorizedJSONResponse GenericErrorMessage
type N500InternalServerError ¶
type N500InternalServerError = GenericErrorMessage
N500InternalServerError defines model for 500-InternalServerError.
type N500InternalServerErrorJSONResponse ¶
type N500InternalServerErrorJSONResponse GenericErrorMessage
type NewComment ¶
type NewComment struct {
AuthorId string `json:"authorId"`
Content string `json:"content"`
ParentCommentId *string `json:"parentCommentId"`
TopicId string `json:"topicId"`
}
NewComment defines model for NewComment.
type NewTopic ¶
type NewTopic struct {
AuthorId string `json:"authorId"`
Image *string `json:"image"`
Summary string `json:"summary"`
Title string `json:"title"`
Url *string `json:"url"`
Video *string `json:"video"`
}
NewTopic defines model for NewTopic.
type PaginatedComments ¶
type PaginatedComments struct {
CurrentPage *int `json:"currentPage,omitempty"`
Items *[]Comment `json:"items,omitempty"`
PageSize *int `json:"pageSize,omitempty"`
TotalItems *int `json:"totalItems,omitempty"`
}
PaginatedComments defines model for PaginatedComments.
type PaginatedTopics ¶
type PaginatedTopics struct {
CurrentPage *int `json:"currentPage,omitempty"`
Items *[]Topic `json:"items,omitempty"`
PageSize *int `json:"pageSize,omitempty"`
TotalItems *int `json:"totalItems,omitempty"`
}
PaginatedTopics defines model for PaginatedTopics.
type RequiredHeaderError ¶
func (*RequiredHeaderError) Error ¶
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶
func (e *RequiredParamError) Error() string
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a struct that implements the API interface
func (Server) CreateComment ¶
func (s Server) CreateComment(ctx context.Context, request CreateCommentRequestObject) (CreateCommentResponseObject, error)
CreateComment creates a comment POST /comments
func (Server) CreateTopic ¶
func (s Server) CreateTopic(ctx context.Context, request CreateTopicRequestObject) (CreateTopicResponseObject, error)
CreateTopic creates a topic POST /topics
func (Server) DeleteComment ¶
func (s Server) DeleteComment(ctx context.Context, request DeleteCommentRequestObject) (DeleteCommentResponseObject, error)
DeleteComment deletes a comment DELETE /comments/{comment_id}
func (Server) DeleteTopic ¶
func (s Server) DeleteTopic(ctx context.Context, request DeleteTopicRequestObject) (DeleteTopicResponseObject, error)
DeleteTopic deletes a topic DELETE /topics/{topic_id}
func (Server) GetComment ¶
func (s Server) GetComment(ctx context.Context, request GetCommentRequestObject) (GetCommentResponseObject, error)
GetComment returns a comment GET /comments/{comment_id}
func (Server) GetTopic ¶
func (s Server) GetTopic(ctx context.Context, request GetTopicRequestObject) (GetTopicResponseObject, error)
GetTopic returns a topic GET /topics/{topic_id}
func (Server) HealthCheck ¶
func (s Server) HealthCheck(ctx context.Context, request HealthCheckRequestObject) (HealthCheckResponseObject, error)
HealthCheck returns info about the server health status and important dependencies GET /health
func (Server) ListComments ¶
func (s Server) ListComments(ctx context.Context, request ListCommentsRequestObject) (ListCommentsResponseObject, error)
ListComments returns a list of comments GET /comments
func (Server) ListTopics ¶
func (s Server) ListTopics(ctx context.Context, request ListTopicsRequestObject) (ListTopicsResponseObject, error)
ListTopics returns a list of topics GET /topics
func (Server) UpdateComment ¶
func (s Server) UpdateComment(ctx context.Context, request UpdateCommentRequestObject) (UpdateCommentResponseObject, error)
UpdateComment updates a comment PUT /comments/{comment_id}
func (Server) UpdateTopic ¶
func (s Server) UpdateTopic(ctx context.Context, request UpdateTopicRequestObject) (UpdateTopicResponseObject, error)
UpdateTopic updates a topic PUT /topics/{topic_id}
type ServerInterface ¶
type ServerInterface interface {
// Delete a comment by ID
// (DELETE /v1/comments/{commentId})
DeleteComment(w http.ResponseWriter, r *http.Request, commentId string)
// Get a comment by ID
// (GET /v1/comments/{commentId})
GetComment(w http.ResponseWriter, r *http.Request, commentId string)
// Update a comment by ID
// (PUT /v1/comments/{commentId})
UpdateComment(w http.ResponseWriter, r *http.Request, commentId string)
// Health check
// (GET /v1/health)
HealthCheck(w http.ResponseWriter, r *http.Request)
// List all topics
// (GET /v1/topics)
ListTopics(w http.ResponseWriter, r *http.Request, params ListTopicsParams)
// Create a new topic
// (POST /v1/topics)
CreateTopic(w http.ResponseWriter, r *http.Request)
// Delete a topic by ID
// (DELETE /v1/topics/{topicId})
DeleteTopic(w http.ResponseWriter, r *http.Request, topicId string)
// Get a topic by ID
// (GET /v1/topics/{topicId})
GetTopic(w http.ResponseWriter, r *http.Request, topicId string)
// Update a topic by ID
// (PUT /v1/topics/{topicId})
UpdateTopic(w http.ResponseWriter, r *http.Request, topicId string)
// List all comments for a topic
// (GET /v1/topics/{topicId}/comments)
ListComments(w http.ResponseWriter, r *http.Request, topicId string, params ListCommentsParams)
// Create a new comment for a topic
// (POST /v1/topics/{topicId}/comments)
CreateComment(w http.ResponseWriter, r *http.Request, topicId string)
}
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
func NewStrictHandlerWithOptions ¶
func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) CreateComment ¶
func (siw *ServerInterfaceWrapper) CreateComment(w http.ResponseWriter, r *http.Request)
CreateComment operation middleware
func (*ServerInterfaceWrapper) CreateTopic ¶
func (siw *ServerInterfaceWrapper) CreateTopic(w http.ResponseWriter, r *http.Request)
CreateTopic operation middleware
func (*ServerInterfaceWrapper) DeleteComment ¶
func (siw *ServerInterfaceWrapper) DeleteComment(w http.ResponseWriter, r *http.Request)
DeleteComment operation middleware
func (*ServerInterfaceWrapper) DeleteTopic ¶
func (siw *ServerInterfaceWrapper) DeleteTopic(w http.ResponseWriter, r *http.Request)
DeleteTopic operation middleware
func (*ServerInterfaceWrapper) GetComment ¶
func (siw *ServerInterfaceWrapper) GetComment(w http.ResponseWriter, r *http.Request)
GetComment operation middleware
func (*ServerInterfaceWrapper) GetTopic ¶
func (siw *ServerInterfaceWrapper) GetTopic(w http.ResponseWriter, r *http.Request)
GetTopic operation middleware
func (*ServerInterfaceWrapper) HealthCheck ¶
func (siw *ServerInterfaceWrapper) HealthCheck(w http.ResponseWriter, r *http.Request)
HealthCheck operation middleware
func (*ServerInterfaceWrapper) ListComments ¶
func (siw *ServerInterfaceWrapper) ListComments(w http.ResponseWriter, r *http.Request)
ListComments operation middleware
func (*ServerInterfaceWrapper) ListTopics ¶
func (siw *ServerInterfaceWrapper) ListTopics(w http.ResponseWriter, r *http.Request)
ListTopics operation middleware
func (*ServerInterfaceWrapper) UpdateComment ¶
func (siw *ServerInterfaceWrapper) UpdateComment(w http.ResponseWriter, r *http.Request)
UpdateComment operation middleware
func (*ServerInterfaceWrapper) UpdateTopic ¶
func (siw *ServerInterfaceWrapper) UpdateTopic(w http.ResponseWriter, r *http.Request)
UpdateTopic operation middleware
type StrictHTTPServerOptions ¶
type StrictHTTPServerOptions struct {
RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type StrictHandlerFunc ¶
type StrictHandlerFunc = strictnethttp.StrictHTTPHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = strictnethttp.StrictHTTPMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// Delete a comment by ID
// (DELETE /v1/comments/{commentId})
DeleteComment(ctx context.Context, request DeleteCommentRequestObject) (DeleteCommentResponseObject, error)
// Get a comment by ID
// (GET /v1/comments/{commentId})
GetComment(ctx context.Context, request GetCommentRequestObject) (GetCommentResponseObject, error)
// Update a comment by ID
// (PUT /v1/comments/{commentId})
UpdateComment(ctx context.Context, request UpdateCommentRequestObject) (UpdateCommentResponseObject, error)
// Health check
// (GET /v1/health)
HealthCheck(ctx context.Context, request HealthCheckRequestObject) (HealthCheckResponseObject, error)
// List all topics
// (GET /v1/topics)
ListTopics(ctx context.Context, request ListTopicsRequestObject) (ListTopicsResponseObject, error)
// Create a new topic
// (POST /v1/topics)
CreateTopic(ctx context.Context, request CreateTopicRequestObject) (CreateTopicResponseObject, error)
// Delete a topic by ID
// (DELETE /v1/topics/{topicId})
DeleteTopic(ctx context.Context, request DeleteTopicRequestObject) (DeleteTopicResponseObject, error)
// Get a topic by ID
// (GET /v1/topics/{topicId})
GetTopic(ctx context.Context, request GetTopicRequestObject) (GetTopicResponseObject, error)
// Update a topic by ID
// (PUT /v1/topics/{topicId})
UpdateTopic(ctx context.Context, request UpdateTopicRequestObject) (UpdateTopicResponseObject, error)
// List all comments for a topic
// (GET /v1/topics/{topicId}/comments)
ListComments(ctx context.Context, request ListCommentsRequestObject) (ListCommentsResponseObject, error)
// Create a new comment for a topic
// (POST /v1/topics/{topicId}/comments)
CreateComment(ctx context.Context, request CreateCommentRequestObject) (CreateCommentResponseObject, error)
}
StrictServerInterface represents all server handlers.
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type Topic ¶
type Topic struct {
AuthorId string `json:"authorId"`
CreatedAt time.Time `json:"createdAt"`
Id string `json:"id"`
Image *string `json:"image"`
Summary string `json:"summary"`
Title string `json:"title"`
UpdatedAt time.Time `json:"updatedAt"`
Url *string `json:"url"`
Video *string `json:"video"`
}
Topic defines model for Topic.
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) CreateComment ¶
func (_ Unimplemented) CreateComment(w http.ResponseWriter, r *http.Request, topicId string)
Create a new comment for a topic (POST /v1/topics/{topicId}/comments)
func (Unimplemented) CreateTopic ¶
func (_ Unimplemented) CreateTopic(w http.ResponseWriter, r *http.Request)
Create a new topic (POST /v1/topics)
func (Unimplemented) DeleteComment ¶
func (_ Unimplemented) DeleteComment(w http.ResponseWriter, r *http.Request, commentId string)
Delete a comment by ID (DELETE /v1/comments/{commentId})
func (Unimplemented) DeleteTopic ¶
func (_ Unimplemented) DeleteTopic(w http.ResponseWriter, r *http.Request, topicId string)
Delete a topic by ID (DELETE /v1/topics/{topicId})
func (Unimplemented) GetComment ¶
func (_ Unimplemented) GetComment(w http.ResponseWriter, r *http.Request, commentId string)
Get a comment by ID (GET /v1/comments/{commentId})
func (Unimplemented) GetTopic ¶
func (_ Unimplemented) GetTopic(w http.ResponseWriter, r *http.Request, topicId string)
Get a topic by ID (GET /v1/topics/{topicId})
func (Unimplemented) HealthCheck ¶
func (_ Unimplemented) HealthCheck(w http.ResponseWriter, r *http.Request)
Health check (GET /v1/health)
func (Unimplemented) ListComments ¶
func (_ Unimplemented) ListComments(w http.ResponseWriter, r *http.Request, topicId string, params ListCommentsParams)
List all comments for a topic (GET /v1/topics/{topicId}/comments)
func (Unimplemented) ListTopics ¶
func (_ Unimplemented) ListTopics(w http.ResponseWriter, r *http.Request, params ListTopicsParams)
List all topics (GET /v1/topics)
func (Unimplemented) UpdateComment ¶
func (_ Unimplemented) UpdateComment(w http.ResponseWriter, r *http.Request, commentId string)
Update a comment by ID (PUT /v1/comments/{commentId})
func (Unimplemented) UpdateTopic ¶
func (_ Unimplemented) UpdateTopic(w http.ResponseWriter, r *http.Request, topicId string)
Update a topic by ID (PUT /v1/topics/{topicId})
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error
type UpdateComment200JSONResponse ¶
type UpdateComment200JSONResponse Comment
func (UpdateComment200JSONResponse) VisitUpdateCommentResponse ¶
func (response UpdateComment200JSONResponse) VisitUpdateCommentResponse(w http.ResponseWriter) error
type UpdateComment400JSONResponse ¶
type UpdateComment400JSONResponse struct{ N400BadRequestJSONResponse }
func (UpdateComment400JSONResponse) VisitUpdateCommentResponse ¶
func (response UpdateComment400JSONResponse) VisitUpdateCommentResponse(w http.ResponseWriter) error
type UpdateComment401JSONResponse ¶
func (UpdateComment401JSONResponse) VisitUpdateCommentResponse ¶
func (response UpdateComment401JSONResponse) VisitUpdateCommentResponse(w http.ResponseWriter) error
type UpdateComment500JSONResponse ¶
type UpdateComment500JSONResponse struct {
N500InternalServerErrorJSONResponse
}
func (UpdateComment500JSONResponse) VisitUpdateCommentResponse ¶
func (response UpdateComment500JSONResponse) VisitUpdateCommentResponse(w http.ResponseWriter) error
type UpdateCommentJSONRequestBody ¶
type UpdateCommentJSONRequestBody = Comment
UpdateCommentJSONRequestBody defines body for UpdateComment for application/json ContentType.
type UpdateCommentRequestObject ¶
type UpdateCommentRequestObject struct {
CommentId string `json:"commentId"`
Body *UpdateCommentJSONRequestBody
}
type UpdateCommentResponseObject ¶
type UpdateCommentResponseObject interface {
VisitUpdateCommentResponse(w http.ResponseWriter) error
}
type UpdateTopic200JSONResponse ¶
type UpdateTopic200JSONResponse Topic
func (UpdateTopic200JSONResponse) VisitUpdateTopicResponse ¶
func (response UpdateTopic200JSONResponse) VisitUpdateTopicResponse(w http.ResponseWriter) error
type UpdateTopic400JSONResponse ¶
type UpdateTopic400JSONResponse struct{ N400BadRequestJSONResponse }
func (UpdateTopic400JSONResponse) VisitUpdateTopicResponse ¶
func (response UpdateTopic400JSONResponse) VisitUpdateTopicResponse(w http.ResponseWriter) error
type UpdateTopic401JSONResponse ¶
func (UpdateTopic401JSONResponse) VisitUpdateTopicResponse ¶
func (response UpdateTopic401JSONResponse) VisitUpdateTopicResponse(w http.ResponseWriter) error
type UpdateTopic500JSONResponse ¶
type UpdateTopic500JSONResponse struct {
N500InternalServerErrorJSONResponse
}
func (UpdateTopic500JSONResponse) VisitUpdateTopicResponse ¶
func (response UpdateTopic500JSONResponse) VisitUpdateTopicResponse(w http.ResponseWriter) error
type UpdateTopicJSONRequestBody ¶
type UpdateTopicJSONRequestBody = Topic
UpdateTopicJSONRequestBody defines body for UpdateTopic for application/json ContentType.
type UpdateTopicRequestObject ¶
type UpdateTopicRequestObject struct {
TopicId string `json:"topicId"`
Body *UpdateTopicJSONRequestBody
}
type UpdateTopicResponseObject ¶
type UpdateTopicResponseObject interface {
VisitUpdateTopicResponse(w http.ResponseWriter) error
}