Documentation
¶
Overview ¶
Package rest provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.
Index ¶
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler
- type CreateTask201JSONResponse
- type CreateTask400JSONResponse
- type CreateTask500JSONResponse
- type CreateTaskJSONBody
- type CreateTaskJSONRequestBody
- type CreateTaskRequestObject
- type CreateTaskResponseObject
- type CreateTasksRequest
- type CreateTasksResponse
- type CreateTasksResponseJSONResponse
- type Dates
- type DeleteTask200Response
- type DeleteTask404Response
- type DeleteTask500JSONResponse
- type DeleteTaskRequestObject
- type DeleteTaskResponseObject
- type ErrorResponse
- type ErrorResponseJSONResponse
- type InvalidParamFormatError
- type MiddlewareFunc
- type Priority
- type ReadTask200JSONResponse
- type ReadTask404Response
- type ReadTask500JSONResponse
- type ReadTaskRequestObject
- type ReadTaskResponseObject
- type ReadTasksResponse
- type ReadTasksResponseJSONResponse
- type RequiredHeaderError
- type RequiredParamError
- type SearchTask200JSONResponse
- type SearchTask400JSONResponse
- type SearchTask500JSONResponse
- type SearchTaskJSONBody
- type SearchTaskJSONRequestBody
- type SearchTaskRequestObject
- type SearchTaskResponseObject
- type SearchTasksRequest
- type SearchTasksResponse
- type SearchTasksResponseJSONResponse
- type ServeMux
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CreateTask(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteTask(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ReadTask(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SearchTask(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) UpdateTask(w http.ResponseWriter, r *http.Request)
- type StdHTTPServerOptions
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type Task
- type TaskHandler
- func (t *TaskHandler) CreateTask(ctx context.Context, req CreateTaskRequestObject) (CreateTaskResponseObject, error)
- func (t *TaskHandler) DeleteTask(ctx context.Context, request DeleteTaskRequestObject) (DeleteTaskResponseObject, error)
- func (t *TaskHandler) ReadTask(ctx context.Context, request ReadTaskRequestObject) (ReadTaskResponseObject, error)
- func (t *TaskHandler) SearchTask(ctx context.Context, req SearchTaskRequestObject) (SearchTaskResponseObject, error)
- func (t *TaskHandler) UpdateTask(ctx context.Context, req UpdateTaskRequestObject) (UpdateTaskResponseObject, error)
- type TaskService
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshalingParamError
- type UpdateTask200Response
- type UpdateTask400JSONResponse
- type UpdateTask404Response
- type UpdateTask500JSONResponse
- type UpdateTaskJSONBody
- type UpdateTaskJSONRequestBody
- type UpdateTaskRequestObject
- type UpdateTaskResponseObject
- type UpdateTasksRequest
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, m ServeMux) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerFromMuxWithBaseURL ¶
func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type CreateTask201JSONResponse ¶
type CreateTask201JSONResponse struct {
CreateTasksResponseJSONResponse
}
func (CreateTask201JSONResponse) VisitCreateTaskResponse ¶
func (response CreateTask201JSONResponse) VisitCreateTaskResponse(w http.ResponseWriter) error
type CreateTask400JSONResponse ¶
type CreateTask400JSONResponse struct{ ErrorResponseJSONResponse }
func (CreateTask400JSONResponse) VisitCreateTaskResponse ¶
func (response CreateTask400JSONResponse) VisitCreateTaskResponse(w http.ResponseWriter) error
type CreateTask500JSONResponse ¶
type CreateTask500JSONResponse struct {
Error string `json:"error"`
}
func (CreateTask500JSONResponse) VisitCreateTaskResponse ¶
func (response CreateTask500JSONResponse) VisitCreateTaskResponse(w http.ResponseWriter) error
type CreateTaskJSONBody ¶
type CreateTaskJSONBody struct {
Dates *Dates `json:"dates,omitempty"`
Description string `json:"description"`
Priority *Priority `json:"priority,omitempty"`
}
CreateTaskJSONBody defines parameters for CreateTask.
type CreateTaskJSONRequestBody ¶
type CreateTaskJSONRequestBody CreateTaskJSONBody
CreateTaskJSONRequestBody defines body for CreateTask for application/json ContentType.
type CreateTaskRequestObject ¶
type CreateTaskRequestObject struct {
Body *CreateTaskJSONRequestBody
}
type CreateTaskResponseObject ¶
type CreateTaskResponseObject interface {
VisitCreateTaskResponse(w http.ResponseWriter) error
}
type CreateTasksRequest ¶
type CreateTasksRequest struct {
Dates *Dates `json:"dates,omitempty"`
Description string `json:"description"`
Priority *Priority `json:"priority,omitempty"`
}
CreateTasksRequest defines model for CreateTasksRequest.
type CreateTasksResponse ¶
type CreateTasksResponse struct {
Task Task `json:"task"`
}
CreateTasksResponse defines model for CreateTasksResponse.
type CreateTasksResponseJSONResponse ¶
type CreateTasksResponseJSONResponse struct {
Task Task `json:"task"`
}
type Dates ¶
type Dates struct {
// Due When the task is expected to be due, seconds are dropped.
Due *time.Time `json:"due"`
// Start When the task is expected to begin, seconds are dropped.
Start *time.Time `json:"start"`
}
Dates defines model for Dates.
type DeleteTask200Response ¶
type DeleteTask200Response struct {
}
func (DeleteTask200Response) VisitDeleteTaskResponse ¶
func (response DeleteTask200Response) VisitDeleteTaskResponse(w http.ResponseWriter) error
type DeleteTask404Response ¶
type DeleteTask404Response struct {
}
func (DeleteTask404Response) VisitDeleteTaskResponse ¶
func (response DeleteTask404Response) VisitDeleteTaskResponse(w http.ResponseWriter) error
type DeleteTask500JSONResponse ¶
type DeleteTask500JSONResponse struct{ ErrorResponseJSONResponse }
func (DeleteTask500JSONResponse) VisitDeleteTaskResponse ¶
func (response DeleteTask500JSONResponse) VisitDeleteTaskResponse(w http.ResponseWriter) error
type DeleteTaskRequestObject ¶
type DeleteTaskRequestObject struct {
Id googleuuid.UUID `json:"id"`
}
type DeleteTaskResponseObject ¶
type DeleteTaskResponseObject interface {
VisitDeleteTaskResponse(w http.ResponseWriter) error
}
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse defines model for ErrorResponse.
type ErrorResponseJSONResponse ¶
type ErrorResponseJSONResponse struct {
Error string `json:"error"`
}
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type Priority ¶
type Priority string
Priority defines model for Priority.
const ( PriorityHigh Priority = "high" PriorityLow Priority = "low" PriorityMedium Priority = "medium" PriorityNone Priority = "none" )
Defines values for Priority.
func NewPriority ¶
NewPriority converts the received domain type to a rest type, when the argument is unknown "none" is used.
type ReadTask200JSONResponse ¶
type ReadTask200JSONResponse struct{ ReadTasksResponseJSONResponse }
func (ReadTask200JSONResponse) VisitReadTaskResponse ¶
func (response ReadTask200JSONResponse) VisitReadTaskResponse(w http.ResponseWriter) error
type ReadTask404Response ¶
type ReadTask404Response struct {
}
func (ReadTask404Response) VisitReadTaskResponse ¶
func (response ReadTask404Response) VisitReadTaskResponse(w http.ResponseWriter) error
type ReadTask500JSONResponse ¶
type ReadTask500JSONResponse struct{ ErrorResponseJSONResponse }
func (ReadTask500JSONResponse) VisitReadTaskResponse ¶
func (response ReadTask500JSONResponse) VisitReadTaskResponse(w http.ResponseWriter) error
type ReadTaskRequestObject ¶
type ReadTaskRequestObject struct {
Id googleuuid.UUID `json:"id"`
}
type ReadTaskResponseObject ¶
type ReadTaskResponseObject interface {
VisitReadTaskResponse(w http.ResponseWriter) error
}
type ReadTasksResponse ¶
type ReadTasksResponse struct {
Task *Task `json:"task,omitempty"`
}
ReadTasksResponse defines model for ReadTasksResponse.
type ReadTasksResponseJSONResponse ¶
type ReadTasksResponseJSONResponse struct {
Task *Task `json:"task,omitempty"`
}
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 SearchTask200JSONResponse ¶
type SearchTask200JSONResponse struct {
SearchTasksResponseJSONResponse
}
func (SearchTask200JSONResponse) VisitSearchTaskResponse ¶
func (response SearchTask200JSONResponse) VisitSearchTaskResponse(w http.ResponseWriter) error
type SearchTask400JSONResponse ¶
type SearchTask400JSONResponse struct{ ErrorResponseJSONResponse }
func (SearchTask400JSONResponse) VisitSearchTaskResponse ¶
func (response SearchTask400JSONResponse) VisitSearchTaskResponse(w http.ResponseWriter) error
type SearchTask500JSONResponse ¶
type SearchTask500JSONResponse struct {
Error string `json:"error"`
}
func (SearchTask500JSONResponse) VisitSearchTaskResponse ¶
func (response SearchTask500JSONResponse) VisitSearchTaskResponse(w http.ResponseWriter) error
type SearchTaskJSONBody ¶
type SearchTaskJSONBody struct {
Description *string `json:"description"`
From int64 `json:"from"`
IsDone *bool `json:"isDone"`
Priority *Priority `json:"priority,omitempty"`
Size int64 `json:"size"`
}
SearchTaskJSONBody defines parameters for SearchTask.
type SearchTaskJSONRequestBody ¶
type SearchTaskJSONRequestBody SearchTaskJSONBody
SearchTaskJSONRequestBody defines body for SearchTask for application/json ContentType.
type SearchTaskRequestObject ¶
type SearchTaskRequestObject struct {
Body *SearchTaskJSONRequestBody
}
type SearchTaskResponseObject ¶
type SearchTaskResponseObject interface {
VisitSearchTaskResponse(w http.ResponseWriter) error
}
type SearchTasksRequest ¶
type SearchTasksRequest struct {
Description *string `json:"description"`
From int64 `json:"from"`
IsDone *bool `json:"isDone"`
Priority *Priority `json:"priority,omitempty"`
Size int64 `json:"size"`
}
SearchTasksRequest defines model for SearchTasksRequest.
type SearchTasksResponse ¶
type SearchTasksResponse struct {
Tasks *[]Task `json:"tasks,omitempty"`
Total *int64 `json:"total,omitempty"`
}
SearchTasksResponse defines model for SearchTasksResponse.
type ServeMux ¶
type ServeMux interface {
HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
ServeHTTP(w http.ResponseWriter, r *http.Request)
}
ServeMux is an abstraction of http.ServeMux.
type ServerInterface ¶
type ServerInterface interface {
// (POST /tasks)
CreateTask(w http.ResponseWriter, r *http.Request)
// (POST /tasks/search)
SearchTask(w http.ResponseWriter, r *http.Request)
// (DELETE /tasks/{id})
DeleteTask(w http.ResponseWriter, r *http.Request, id googleuuid.UUID)
// (GET /tasks/{id})
ReadTask(w http.ResponseWriter, r *http.Request, id googleuuid.UUID)
// (PUT /tasks/{id})
UpdateTask(w http.ResponseWriter, r *http.Request, id googleuuid.UUID)
}
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) CreateTask ¶
func (siw *ServerInterfaceWrapper) CreateTask(w http.ResponseWriter, r *http.Request)
CreateTask operation middleware
func (*ServerInterfaceWrapper) DeleteTask ¶
func (siw *ServerInterfaceWrapper) DeleteTask(w http.ResponseWriter, r *http.Request)
DeleteTask operation middleware
func (*ServerInterfaceWrapper) ReadTask ¶
func (siw *ServerInterfaceWrapper) ReadTask(w http.ResponseWriter, r *http.Request)
ReadTask operation middleware
func (*ServerInterfaceWrapper) SearchTask ¶
func (siw *ServerInterfaceWrapper) SearchTask(w http.ResponseWriter, r *http.Request)
SearchTask operation middleware
func (*ServerInterfaceWrapper) UpdateTask ¶
func (siw *ServerInterfaceWrapper) UpdateTask(w http.ResponseWriter, r *http.Request)
UpdateTask operation middleware
type StdHTTPServerOptions ¶
type StdHTTPServerOptions struct {
BaseURL string
BaseRouter ServeMux
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
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 {
// (POST /tasks)
CreateTask(ctx context.Context, request CreateTaskRequestObject) (CreateTaskResponseObject, error)
// (POST /tasks/search)
SearchTask(ctx context.Context, request SearchTaskRequestObject) (SearchTaskResponseObject, error)
// (DELETE /tasks/{id})
DeleteTask(ctx context.Context, request DeleteTaskRequestObject) (DeleteTaskResponseObject, error)
// (GET /tasks/{id})
ReadTask(ctx context.Context, request ReadTaskRequestObject) (ReadTaskResponseObject, error)
// (PUT /tasks/{id})
UpdateTask(ctx context.Context, request UpdateTaskRequestObject) (UpdateTaskResponseObject, error)
}
StrictServerInterface represents all server handlers.
type Task ¶
type Task struct {
Dates *Dates `json:"dates,omitempty"`
Description string `json:"description"`
ID googleuuid.UUID `json:"id"`
IsDone *bool `json:"isDone,omitempty"`
Priority *Priority `json:"priority,omitempty"`
}
Task defines model for Task.
type TaskHandler ¶
type TaskHandler struct {
// contains filtered or unexported fields
}
TaskHandler ...
func (*TaskHandler) CreateTask ¶
func (t *TaskHandler) CreateTask(ctx context.Context, req CreateTaskRequestObject) (CreateTaskResponseObject, error)
func (*TaskHandler) DeleteTask ¶
func (t *TaskHandler) DeleteTask(ctx context.Context, request DeleteTaskRequestObject) (DeleteTaskResponseObject, error)
func (*TaskHandler) ReadTask ¶
func (t *TaskHandler) ReadTask(ctx context.Context, request ReadTaskRequestObject) (ReadTaskResponseObject, error)
func (*TaskHandler) SearchTask ¶
func (t *TaskHandler) SearchTask(ctx context.Context, req SearchTaskRequestObject) (SearchTaskResponseObject, error)
func (*TaskHandler) UpdateTask ¶
func (t *TaskHandler) UpdateTask(ctx context.Context, req UpdateTaskRequestObject) (UpdateTaskResponseObject, error)
type TaskService ¶
type TaskService interface {
By(ctx context.Context, args internal.SearchParams) (internal.SearchResults, error)
Create(ctx context.Context, params internal.CreateParams) (internal.Task, error)
Delete(ctx context.Context, id string) error
ByID(ctx context.Context, id string) (internal.Task, error)
Update(ctx context.Context, id string, args internal.UpdateParams) error
}
TaskService ...
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error
type UpdateTask200Response ¶
type UpdateTask200Response struct {
}
func (UpdateTask200Response) VisitUpdateTaskResponse ¶
func (response UpdateTask200Response) VisitUpdateTaskResponse(w http.ResponseWriter) error
type UpdateTask400JSONResponse ¶
type UpdateTask400JSONResponse struct{ ErrorResponseJSONResponse }
func (UpdateTask400JSONResponse) VisitUpdateTaskResponse ¶
func (response UpdateTask400JSONResponse) VisitUpdateTaskResponse(w http.ResponseWriter) error
type UpdateTask404Response ¶
type UpdateTask404Response struct {
}
func (UpdateTask404Response) VisitUpdateTaskResponse ¶
func (response UpdateTask404Response) VisitUpdateTaskResponse(w http.ResponseWriter) error
type UpdateTask500JSONResponse ¶
type UpdateTask500JSONResponse struct {
Error string `json:"error"`
}
func (UpdateTask500JSONResponse) VisitUpdateTaskResponse ¶
func (response UpdateTask500JSONResponse) VisitUpdateTaskResponse(w http.ResponseWriter) error
type UpdateTaskJSONBody ¶
type UpdateTaskJSONBody struct {
Dates *Dates `json:"dates,omitempty"`
Description *string `json:"description,omitempty"`
IsDone *bool `json:"isDone,omitempty"`
Priority *Priority `json:"priority,omitempty"`
}
UpdateTaskJSONBody defines parameters for UpdateTask.
type UpdateTaskJSONRequestBody ¶
type UpdateTaskJSONRequestBody UpdateTaskJSONBody
UpdateTaskJSONRequestBody defines body for UpdateTask for application/json ContentType.
type UpdateTaskRequestObject ¶
type UpdateTaskRequestObject struct {
Id googleuuid.UUID `json:"id"`
Body *UpdateTaskJSONRequestBody
}
type UpdateTaskResponseObject ¶
type UpdateTaskResponseObject interface {
VisitUpdateTaskResponse(w http.ResponseWriter) error
}