timetrackapi

package
v0.0.0-...-5983c14 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 5 Imported by: 0

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

View Source
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 HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, m *http.ServeMux, baseURL string) http.Handler

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

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

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

type ReportRequest struct {
	From time.Time `json:"from"`
	To   time.Time `json:"to"`
}

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

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

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

type TaskResponse struct {
	Description string `json:"description"`
	Id          int    `json:"id"`
}

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

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

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.

type UserResponse

type UserResponse struct {
	Address        string  `json:"address"`
	Id             int     `json:"id"`
	Name           string  `json:"name"`
	PassportNumber string  `json:"passportNumber"`
	Patronymic     *string `json:"patronymic,omitempty"`
	Surname        string  `json:"surname"`
}

UserResponse defines model for UserResponse.

Jump to

Keyboard shortcuts

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