Documentation
¶
Overview ¶
Package timetrackapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.3.0 DO NOT EDIT.
Index ¶
- Constants
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, m *http.ServeMux) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, m *http.ServeMux, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler
- type AuthRequest
- type AuthRequestGrantType
- type CreateTaskRequest
- type CreateUserRequest
- type ErrorResponse
- type GetTasksParams
- type GetUsersParams
- type HealthResponse
- type InvalidParamFormatError
- type MiddlewareFunc
- type PatchTasksIdJSONRequestBody
- type PatchUsersIdJSONRequestBody
- type PostAuthFormdataRequestBody
- type PostTasksJSONRequestBody
- type PostUsersIdReportJSONRequestBody
- type PostUsersJSONRequestBody
- type ReportDurationResponse
- type ReportRequest
- type ReportTaskResponse
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) DeleteTasksId(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteUsersId(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetTasks(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetTasksId(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetUsers(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetUsersCurrent(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetUsersId(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PatchTasksId(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PatchUsersId(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostAuth(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostTasks(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostTasksIdStart(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostTasksIdStop(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostUsers(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostUsersIdReport(w http.ResponseWriter, r *http.Request)
- type StdHTTPServerOptions
- type TaskResponse
- type TokenResponse
- type TokenResponseTokenType
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshalingParamError
- type UpdateTaskRequest
- type UpdateUserRequest
- type UserResponse
Constants ¶
const (
BearerAuthScopes = "bearerAuth.Scopes"
)
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 *http.ServeMux) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type AuthRequest ¶
type AuthRequest struct {
GrantType AuthRequestGrantType `json:"grant_type"`
Password string `json:"password"`
Username string `json:"username"`
}
AuthRequest Password grant (https://datatracker.ietf.org/doc/html/rfc6749#section-4.3).
type AuthRequestGrantType ¶
type AuthRequestGrantType string
AuthRequestGrantType defines model for AuthRequest.GrantType.
const (
Password AuthRequestGrantType = "password"
)
Defines values for AuthRequestGrantType.
type CreateTaskRequest ¶
type CreateTaskRequest struct {
Description string `json:"description"`
}
CreateTaskRequest defines model for CreateTaskRequest.
type CreateUserRequest ¶
type CreateUserRequest struct {
PassportNumber string `json:"passportNumber"`
}
CreateUserRequest defines model for CreateUserRequest.
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
ErrorResponse defines model for ErrorResponse.
type GetTasksParams ¶
type GetTasksParams struct {
Offset *int `form:"offset,omitempty" json:"offset,omitempty"`
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}
GetTasksParams defines parameters for GetTasks.
type GetUsersParams ¶
type GetUsersParams struct {
// Filter Filter by user fields. Can be used multiple times.
Filter *[]string `form:"filter,omitempty" json:"filter,omitempty"`
Offset *int `form:"offset,omitempty" json:"offset,omitempty"`
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}
GetUsersParams defines parameters for GetUsers.
type HealthResponse ¶
type HealthResponse struct {
Status string `json:"status"`
}
HealthResponse defines model for HealthResponse.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type PatchTasksIdJSONRequestBody ¶
type PatchTasksIdJSONRequestBody = UpdateTaskRequest
PatchTasksIdJSONRequestBody defines body for PatchTasksId for application/json ContentType.
type PatchUsersIdJSONRequestBody ¶
type PatchUsersIdJSONRequestBody = UpdateUserRequest
PatchUsersIdJSONRequestBody defines body for PatchUsersId for application/json ContentType.
type PostAuthFormdataRequestBody ¶
type PostAuthFormdataRequestBody = AuthRequest
PostAuthFormdataRequestBody defines body for PostAuth for application/x-www-form-urlencoded ContentType.
type PostTasksJSONRequestBody ¶
type PostTasksJSONRequestBody = CreateTaskRequest
PostTasksJSONRequestBody defines body for PostTasks for application/json ContentType.
type PostUsersIdReportJSONRequestBody ¶
type PostUsersIdReportJSONRequestBody = ReportRequest
PostUsersIdReportJSONRequestBody defines body for PostUsersIdReport for application/json ContentType.
type PostUsersJSONRequestBody ¶
type PostUsersJSONRequestBody = CreateUserRequest
PostUsersJSONRequestBody defines body for PostUsers for application/json ContentType.
type ReportDurationResponse ¶
type ReportDurationResponse struct {
Hours int `json:"hours"`
Minutes int `json:"minutes"`
Seconds int `json:"seconds"`
}
ReportDurationResponse defines model for ReportDurationResponse.
type ReportRequest ¶
ReportRequest defines model for ReportRequest.
type ReportTaskResponse ¶
type ReportTaskResponse struct {
Duration *ReportDurationResponse `json:"duration,omitempty"`
Task *TaskResponse `json:"task,omitempty"`
}
ReportTaskResponse defines model for ReportTaskResponse.
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 ServerInterface ¶
type ServerInterface interface {
// (POST /auth)
PostAuth(w http.ResponseWriter, r *http.Request)
// (GET /health)
GetHealth(w http.ResponseWriter, r *http.Request)
// (GET /tasks/)
GetTasks(w http.ResponseWriter, r *http.Request, params GetTasksParams)
// (POST /tasks/)
PostTasks(w http.ResponseWriter, r *http.Request)
// (DELETE /tasks/{id})
DeleteTasksId(w http.ResponseWriter, r *http.Request, id int)
// (GET /tasks/{id})
GetTasksId(w http.ResponseWriter, r *http.Request, id int)
// (PATCH /tasks/{id})
PatchTasksId(w http.ResponseWriter, r *http.Request, id int)
// (POST /tasks/{id}/start)
PostTasksIdStart(w http.ResponseWriter, r *http.Request, id int)
// (POST /tasks/{id}/stop)
PostTasksIdStop(w http.ResponseWriter, r *http.Request, id int)
// (GET /users/)
GetUsers(w http.ResponseWriter, r *http.Request, params GetUsersParams)
// (POST /users/)
PostUsers(w http.ResponseWriter, r *http.Request)
// (GET /users/current)
GetUsersCurrent(w http.ResponseWriter, r *http.Request)
// (DELETE /users/{id})
DeleteUsersId(w http.ResponseWriter, r *http.Request, id int)
// (GET /users/{id})
GetUsersId(w http.ResponseWriter, r *http.Request, id int)
// (PATCH /users/{id})
PatchUsersId(w http.ResponseWriter, r *http.Request, id int)
// (POST /users/{id}/report)
PostUsersIdReport(w http.ResponseWriter, r *http.Request, id int)
}
ServerInterface represents all server handlers.
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) DeleteTasksId ¶
func (siw *ServerInterfaceWrapper) DeleteTasksId(w http.ResponseWriter, r *http.Request)
DeleteTasksId operation middleware
func (*ServerInterfaceWrapper) DeleteUsersId ¶
func (siw *ServerInterfaceWrapper) DeleteUsersId(w http.ResponseWriter, r *http.Request)
DeleteUsersId operation middleware
func (*ServerInterfaceWrapper) GetHealth ¶
func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Request)
GetHealth operation middleware
func (*ServerInterfaceWrapper) GetTasks ¶
func (siw *ServerInterfaceWrapper) GetTasks(w http.ResponseWriter, r *http.Request)
GetTasks operation middleware
func (*ServerInterfaceWrapper) GetTasksId ¶
func (siw *ServerInterfaceWrapper) GetTasksId(w http.ResponseWriter, r *http.Request)
GetTasksId operation middleware
func (*ServerInterfaceWrapper) GetUsers ¶
func (siw *ServerInterfaceWrapper) GetUsers(w http.ResponseWriter, r *http.Request)
GetUsers operation middleware
func (*ServerInterfaceWrapper) GetUsersCurrent ¶
func (siw *ServerInterfaceWrapper) GetUsersCurrent(w http.ResponseWriter, r *http.Request)
GetUsersCurrent operation middleware
func (*ServerInterfaceWrapper) GetUsersId ¶
func (siw *ServerInterfaceWrapper) GetUsersId(w http.ResponseWriter, r *http.Request)
GetUsersId operation middleware
func (*ServerInterfaceWrapper) PatchTasksId ¶
func (siw *ServerInterfaceWrapper) PatchTasksId(w http.ResponseWriter, r *http.Request)
PatchTasksId operation middleware
func (*ServerInterfaceWrapper) PatchUsersId ¶
func (siw *ServerInterfaceWrapper) PatchUsersId(w http.ResponseWriter, r *http.Request)
PatchUsersId operation middleware
func (*ServerInterfaceWrapper) PostAuth ¶
func (siw *ServerInterfaceWrapper) PostAuth(w http.ResponseWriter, r *http.Request)
PostAuth operation middleware
func (*ServerInterfaceWrapper) PostTasks ¶
func (siw *ServerInterfaceWrapper) PostTasks(w http.ResponseWriter, r *http.Request)
PostTasks operation middleware
func (*ServerInterfaceWrapper) PostTasksIdStart ¶
func (siw *ServerInterfaceWrapper) PostTasksIdStart(w http.ResponseWriter, r *http.Request)
PostTasksIdStart operation middleware
func (*ServerInterfaceWrapper) PostTasksIdStop ¶
func (siw *ServerInterfaceWrapper) PostTasksIdStop(w http.ResponseWriter, r *http.Request)
PostTasksIdStop operation middleware
func (*ServerInterfaceWrapper) PostUsers ¶
func (siw *ServerInterfaceWrapper) PostUsers(w http.ResponseWriter, r *http.Request)
PostUsers operation middleware
func (*ServerInterfaceWrapper) PostUsersIdReport ¶
func (siw *ServerInterfaceWrapper) PostUsersIdReport(w http.ResponseWriter, r *http.Request)
PostUsersIdReport operation middleware
type StdHTTPServerOptions ¶
type StdHTTPServerOptions struct {
BaseURL string
BaseRouter *http.ServeMux
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type TaskResponse ¶
TaskResponse defines model for TaskResponse.
type TokenResponse ¶
type TokenResponse struct {
AccessToken string `json:"access_token"`
TokenType TokenResponseTokenType `json:"token_type"`
}
TokenResponse Token (https://datatracker.ietf.org/doc/html/rfc6749#section-5.1).
type TokenResponseTokenType ¶
type TokenResponseTokenType string
TokenResponseTokenType defines model for TokenResponse.TokenType.
const (
Bearer TokenResponseTokenType = "Bearer"
)
Defines values for TokenResponseTokenType.
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 UpdateTaskRequest ¶
type UpdateTaskRequest struct {
Description *string `json:"description,omitempty"`
}
UpdateTaskRequest defines model for UpdateTaskRequest.
type UpdateUserRequest ¶
type UpdateUserRequest struct {
Address *string `json:"address,omitempty"`
Name *string `json:"name,omitempty"`
PassportNumber *string `json:"passportNumber,omitempty"`
Patronymic *string `json:"patronymic,omitempty"`
PatronymicNull *bool `json:"patronymicNull,omitempty"`
Surname *string `json:"surname,omitempty"`
}
UpdateUserRequest defines model for UpdateUserRequest.