Documentation ¶
Overview ¶
Package openapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.11.0 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine
- func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine
- type AddThirdpartyJSONBody
- type AddThirdpartyJSONRequestBody
- type AddThirdpartyRequest
- type AddTimerecordJSONBody
- type AddTimerecordJSONRequestBody
- type AddTimerecordRequest
- type AddTimerecordResponse
- type CreateEmployeeJSONBody
- type CreateEmployeeJSONRequestBody
- type CreateEmployeeRequest
- type CreateEmployeeResponse
- type DeleteEmployeeParams
- type DeleteEmployeeResponse
- type DownloadImageParams
- type Employee
- type EmployeeBase
- type Error
- type GetEmployeeParams
- type GetEmployeeResponse
- type GetImageDescriptionParams
- type GetImageDescriptionResponse
- type GinServerOptions
- type Image
- type LastTimerecordByEmploeeIDParams
- type LastTimerecordByEmploeeIDResponse
- type ListEmployeesResponse
- type ListThirdpartyResponse
- type ListTimerecordResponse
- type Meta
- type MiddlewareFunc
- type RecognizeEmployeeResponse
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) AddThirdparty(c *gin.Context)
- func (siw *ServerInterfaceWrapper) AddTimerecord(c *gin.Context)
- func (siw *ServerInterfaceWrapper) CreateEmployee(c *gin.Context)
- func (siw *ServerInterfaceWrapper) DeleteEmployee(c *gin.Context)
- func (siw *ServerInterfaceWrapper) DownloadImage(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetEmployee(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetImageDescription(c *gin.Context)
- func (siw *ServerInterfaceWrapper) LastTimerecordByEmploeeID(c *gin.Context)
- func (siw *ServerInterfaceWrapper) ListEmployees(c *gin.Context)
- func (siw *ServerInterfaceWrapper) ListThirdparty(c *gin.Context)
- func (siw *ServerInterfaceWrapper) ListTimerecord(c *gin.Context)
- func (siw *ServerInterfaceWrapper) RecognizeEmployee(c *gin.Context)
- func (siw *ServerInterfaceWrapper) UpdateEmployee(c *gin.Context)
- func (siw *ServerInterfaceWrapper) UploadImage(c *gin.Context)
- type Timerecord
- type TimerecordBase
- type TimerecordTime
- type UpdateEmployeeJSONBody
- type UpdateEmployeeJSONRequestBody
- type UpdateEmployeeRequest
- type UpdateEmployeeResponse
- type UploadImageResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func RegisterHandlers ¶
func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine
RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
func RegisterHandlersWithOptions ¶
func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine
RegisterHandlersWithOptions creates http.Handler with additional options
Types ¶
type AddThirdpartyJSONBody ¶
type AddThirdpartyJSONBody = AddThirdpartyRequest
AddThirdpartyJSONBody defines parameters for AddThirdparty.
type AddThirdpartyJSONRequestBody ¶
type AddThirdpartyJSONRequestBody = AddThirdpartyJSONBody
AddThirdpartyJSONRequestBody defines body for AddThirdparty for application/json ContentType.
type AddThirdpartyRequest ¶
type AddThirdpartyRequest struct {
Url string `json:"url"`
}
AddThirdpartyRequest defines model for AddThirdpartyRequest.
type AddTimerecordJSONBody ¶
type AddTimerecordJSONBody = AddTimerecordRequest
AddTimerecordJSONBody defines parameters for AddTimerecord.
type AddTimerecordJSONRequestBody ¶
type AddTimerecordJSONRequestBody = AddTimerecordJSONBody
AddTimerecordJSONRequestBody defines body for AddTimerecord for application/json ContentType.
type AddTimerecordRequest ¶
type AddTimerecordRequest struct { Employee uint64 `json:"employee"` EntryTime TimerecordTime `json:"entry_time"` ExitTime *TimerecordTime `json:"exit_time,omitempty"` }
AddTimerecordRequest defines model for AddTimerecordRequest.
type AddTimerecordResponse ¶
type AddTimerecordResponse struct { Employee uint64 `json:"employee"` EntryTime TimerecordTime `json:"entry_time"` ExitTime *TimerecordTime `json:"exit_time,omitempty"` ID uint64 `json:"id"` }
AddTimerecordResponse defines model for AddTimerecordResponse.
type CreateEmployeeJSONBody ¶
type CreateEmployeeJSONBody = CreateEmployeeRequest
CreateEmployeeJSONBody defines parameters for CreateEmployee.
type CreateEmployeeJSONRequestBody ¶
type CreateEmployeeJSONRequestBody = CreateEmployeeJSONBody
CreateEmployeeJSONRequestBody defines body for CreateEmployee for application/json ContentType.
type CreateEmployeeRequest ¶
type CreateEmployeeRequest struct { Meta Meta `json:"meta"` Name string `json:"name"` PhotoID uint64 `json:"photo_id"` }
CreateEmployeeRequest defines model for CreateEmployeeRequest.
type CreateEmployeeResponse ¶
type CreateEmployeeResponse struct { ID uint64 `json:"id"` Meta Meta `json:"meta"` Name string `json:"name"` PhotoID uint64 `json:"photo_id"` }
CreateEmployeeResponse defines model for CreateEmployeeResponse.
type DeleteEmployeeParams ¶
type DeleteEmployeeParams struct { // Employee ID ID uint64 `form:"id" json:"id"` }
DeleteEmployeeParams defines parameters for DeleteEmployee.
type DeleteEmployeeResponse ¶
type DeleteEmployeeResponse struct {
Message string `json:"message"`
}
DeleteEmployeeResponse defines model for DeleteEmployeeResponse.
type DownloadImageParams ¶
type DownloadImageParams struct { // Image ID ID uint64 `form:"id" json:"id"` }
DownloadImageParams defines parameters for DownloadImage.
type Employee ¶
type Employee struct { ID uint64 `json:"id"` Meta Meta `json:"meta"` Name string `json:"name"` PhotoID uint64 `json:"photo_id"` }
Employee defines model for Employee.
type EmployeeBase ¶
type EmployeeBase struct { Meta Meta `json:"meta"` Name string `json:"name"` PhotoID uint64 `json:"photo_id"` }
EmployeeBase defines model for EmployeeBase.
type GetEmployeeParams ¶
type GetEmployeeParams struct { // Employee ID ID uint64 `form:"id" json:"id"` }
GetEmployeeParams defines parameters for GetEmployee.
type GetEmployeeResponse ¶
type GetEmployeeResponse struct { ID uint64 `json:"id"` Meta Meta `json:"meta"` Name string `json:"name"` PhotoID uint64 `json:"photo_id"` }
GetEmployeeResponse defines model for GetEmployeeResponse.
type GetImageDescriptionParams ¶
type GetImageDescriptionParams struct { // Image ID ID uint64 `form:"id" json:"id"` }
GetImageDescriptionParams defines parameters for GetImageDescription.
type GetImageDescriptionResponse ¶
GetImageDescriptionResponse defines model for GetImageDescriptionResponse.
type GinServerOptions ¶
type GinServerOptions struct { BaseURL string Middlewares []MiddlewareFunc }
GinServerOptions provides options for the Gin server.
type LastTimerecordByEmploeeIDParams ¶
type LastTimerecordByEmploeeIDParams struct { // Employee ID ID uint64 `form:"id" json:"id"` }
LastTimerecordByEmploeeIDParams defines parameters for LastTimerecordByEmploeeID.
type LastTimerecordByEmploeeIDResponse ¶
type LastTimerecordByEmploeeIDResponse struct { Employee uint64 `json:"employee"` EntryTime TimerecordTime `json:"entry_time"` ExitTime *TimerecordTime `json:"exit_time,omitempty"` ID uint64 `json:"id"` }
LastTimerecordByEmploeeIDResponse defines model for LastTimerecordByEmploeeIDResponse.
type ListEmployeesResponse ¶
type ListEmployeesResponse = []Employee
ListEmployeesResponse defines model for ListEmployeesResponse.
type ListThirdpartyResponse ¶
type ListThirdpartyResponse = []string
ListThirdpartyResponse defines model for ListThirdpartyResponse.
type ListTimerecordResponse ¶
type ListTimerecordResponse = []Timerecord
ListTimerecordResponse defines model for ListTimerecordResponse.
type Meta ¶
type Meta struct {
AdditionalProperties map[string]interface{} `json:"-"`
}
Meta defines model for Meta.
func (Meta) Get ¶
Getter for additional properties for Meta. Returns the specified element and whether it was found
func (Meta) MarshalJSON ¶
Override default JSON handling for Meta to handle AdditionalProperties
func (*Meta) UnmarshalJSON ¶
Override default JSON handling for Meta to handle AdditionalProperties
type MiddlewareFunc ¶
type RecognizeEmployeeResponse ¶
type RecognizeEmployeeResponse struct { ID uint64 `json:"id"` Meta Meta `json:"meta"` Name string `json:"name"` PhotoID uint64 `json:"photo_id"` }
RecognizeEmployeeResponse defines model for RecognizeEmployeeResponse.
type ServerInterface ¶
type ServerInterface interface { // Upload image on server // (POST /image/upload) UploadImage(c *gin.Context) // Get image description // (GET /images/data) GetImageDescription(c *gin.Context, params GetImageDescriptionParams) // Download image from server // (GET /images/file) DownloadImage(c *gin.Context, params DownloadImageParams) // Create new employee // (POST /staff/add) CreateEmployee(c *gin.Context) // Get all staff // (GET /staff/all) ListEmployees(c *gin.Context) // Delete employee // (DELETE /staff/delete) DeleteEmployee(c *gin.Context, params DeleteEmployeeParams) // Get employee // (GET /staff/get) GetEmployee(c *gin.Context, params GetEmployeeParams) // Recognize employee // (POST /staff/recognize) RecognizeEmployee(c *gin.Context) // Update employee // (PUT /staff/update) UpdateEmployee(c *gin.Context) // Add new thirdparty link // (POST /thirdparty/add) AddThirdparty(c *gin.Context) // Get thirdparty list of links // (GET /thirdparty/all) ListThirdparty(c *gin.Context) // Save timerecord event about staff // (POST /timerecord/add) AddTimerecord(c *gin.Context) // Get list of all timerecord events // (GET /timerecord/all) ListTimerecord(c *gin.Context) // Get last timerecord by employee // (GET /timerecord/lastbyemployee) LastTimerecordByEmploeeID(c *gin.Context, params LastTimerecordByEmploeeIDParams) }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct { Handler ServerInterface HandlerMiddlewares []MiddlewareFunc }
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) AddThirdparty ¶
func (siw *ServerInterfaceWrapper) AddThirdparty(c *gin.Context)
AddThirdparty operation middleware
func (*ServerInterfaceWrapper) AddTimerecord ¶
func (siw *ServerInterfaceWrapper) AddTimerecord(c *gin.Context)
AddTimerecord operation middleware
func (*ServerInterfaceWrapper) CreateEmployee ¶
func (siw *ServerInterfaceWrapper) CreateEmployee(c *gin.Context)
CreateEmployee operation middleware
func (*ServerInterfaceWrapper) DeleteEmployee ¶
func (siw *ServerInterfaceWrapper) DeleteEmployee(c *gin.Context)
DeleteEmployee operation middleware
func (*ServerInterfaceWrapper) DownloadImage ¶
func (siw *ServerInterfaceWrapper) DownloadImage(c *gin.Context)
DownloadImage operation middleware
func (*ServerInterfaceWrapper) GetEmployee ¶
func (siw *ServerInterfaceWrapper) GetEmployee(c *gin.Context)
GetEmployee operation middleware
func (*ServerInterfaceWrapper) GetImageDescription ¶
func (siw *ServerInterfaceWrapper) GetImageDescription(c *gin.Context)
GetImageDescription operation middleware
func (*ServerInterfaceWrapper) LastTimerecordByEmploeeID ¶
func (siw *ServerInterfaceWrapper) LastTimerecordByEmploeeID(c *gin.Context)
LastTimerecordByEmploeeID operation middleware
func (*ServerInterfaceWrapper) ListEmployees ¶
func (siw *ServerInterfaceWrapper) ListEmployees(c *gin.Context)
ListEmployees operation middleware
func (*ServerInterfaceWrapper) ListThirdparty ¶
func (siw *ServerInterfaceWrapper) ListThirdparty(c *gin.Context)
ListThirdparty operation middleware
func (*ServerInterfaceWrapper) ListTimerecord ¶
func (siw *ServerInterfaceWrapper) ListTimerecord(c *gin.Context)
ListTimerecord operation middleware
func (*ServerInterfaceWrapper) RecognizeEmployee ¶
func (siw *ServerInterfaceWrapper) RecognizeEmployee(c *gin.Context)
RecognizeEmployee operation middleware
func (*ServerInterfaceWrapper) UpdateEmployee ¶
func (siw *ServerInterfaceWrapper) UpdateEmployee(c *gin.Context)
UpdateEmployee operation middleware
func (*ServerInterfaceWrapper) UploadImage ¶
func (siw *ServerInterfaceWrapper) UploadImage(c *gin.Context)
UploadImage operation middleware
type Timerecord ¶
type Timerecord struct { Employee uint64 `json:"employee"` EntryTime TimerecordTime `json:"entry_time"` ExitTime *TimerecordTime `json:"exit_time,omitempty"` ID uint64 `json:"id"` }
Timerecord defines model for Timerecord.
type TimerecordBase ¶
type TimerecordBase struct { Employee uint64 `json:"employee"` EntryTime TimerecordTime `json:"entry_time"` ExitTime *TimerecordTime `json:"exit_time,omitempty"` }
TimerecordBase defines model for TimerecordBase.
type TimerecordTime ¶
TimerecordTime defines model for TimerecordTime.
type UpdateEmployeeJSONBody ¶
type UpdateEmployeeJSONBody = UpdateEmployeeRequest
UpdateEmployeeJSONBody defines parameters for UpdateEmployee.
type UpdateEmployeeJSONRequestBody ¶
type UpdateEmployeeJSONRequestBody = UpdateEmployeeJSONBody
UpdateEmployeeJSONRequestBody defines body for UpdateEmployee for application/json ContentType.
type UpdateEmployeeRequest ¶
type UpdateEmployeeRequest struct { ID uint64 `json:"id"` Meta Meta `json:"meta"` Name string `json:"name"` PhotoID uint64 `json:"photo_id"` }
UpdateEmployeeRequest defines model for UpdateEmployeeRequest.
type UpdateEmployeeResponse ¶
type UpdateEmployeeResponse struct { ID uint64 `json:"id"` Meta Meta `json:"meta"` Name string `json:"name"` PhotoID uint64 `json:"photo_id"` }
UpdateEmployeeResponse defines model for UpdateEmployeeResponse.
type UploadImageResponse ¶
UploadImageResponse defines model for UploadImageResponse.