oapi

package
v0.0.0-...-1f910d1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package oapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.

Index

Constants

View Source
const (
	OAuth2Scopes = "OAuth2.Scopes"
)

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

Types

type ClockIn200JSONResponse

type ClockIn200JSONResponse EmployeeClockHistory

func (ClockIn200JSONResponse) VisitClockInResponse

func (response ClockIn200JSONResponse) VisitClockInResponse(w http.ResponseWriter) error

type ClockIn401JSONResponse

type ClockIn401JSONResponse struct{ UnauthorizedJSONResponse }

func (ClockIn401JSONResponse) VisitClockInResponse

func (response ClockIn401JSONResponse) VisitClockInResponse(w http.ResponseWriter) error

type ClockIn422JSONResponse

type ClockIn422JSONResponse struct{ ValidationErrorJSONResponse }

func (ClockIn422JSONResponse) VisitClockInResponse

func (response ClockIn422JSONResponse) VisitClockInResponse(w http.ResponseWriter) error

type ClockInJSONRequestBody

type ClockInJSONRequestBody = ClockRequest

ClockInJSONRequestBody defines body for ClockIn for application/json ContentType.

type ClockInRequestObject

type ClockInRequestObject struct {
	Body *ClockInJSONRequestBody
}

type ClockInResponseObject

type ClockInResponseObject interface {
	VisitClockInResponse(w http.ResponseWriter) error
}

type ClockIndefaultJSONResponse

type ClockIndefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (ClockIndefaultJSONResponse) VisitClockInResponse

func (response ClockIndefaultJSONResponse) VisitClockInResponse(w http.ResponseWriter) error

type ClockOut200JSONResponse

type ClockOut200JSONResponse EmployeeClockHistory

func (ClockOut200JSONResponse) VisitClockOutResponse

func (response ClockOut200JSONResponse) VisitClockOutResponse(w http.ResponseWriter) error

type ClockOut401JSONResponse

type ClockOut401JSONResponse struct{ UnauthorizedJSONResponse }

func (ClockOut401JSONResponse) VisitClockOutResponse

func (response ClockOut401JSONResponse) VisitClockOutResponse(w http.ResponseWriter) error

type ClockOut422JSONResponse

type ClockOut422JSONResponse struct{ ValidationErrorJSONResponse }

func (ClockOut422JSONResponse) VisitClockOutResponse

func (response ClockOut422JSONResponse) VisitClockOutResponse(w http.ResponseWriter) error

type ClockOutJSONRequestBody

type ClockOutJSONRequestBody = ClockRequest

ClockOutJSONRequestBody defines body for ClockOut for application/json ContentType.

type ClockOutRequestObject

type ClockOutRequestObject struct {
	Body *ClockOutJSONRequestBody
}

type ClockOutResponseObject

type ClockOutResponseObject interface {
	VisitClockOutResponse(w http.ResponseWriter) error
}

type ClockOutdefaultJSONResponse

type ClockOutdefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (ClockOutdefaultJSONResponse) VisitClockOutResponse

func (response ClockOutdefaultJSONResponse) VisitClockOutResponse(w http.ResponseWriter) error

type ClockRequest

type ClockRequest struct {
	EmployeeId int `json:"employee_id"`
}

ClockRequest defines model for ClockRequest.

type CreateEmployee201Response

type CreateEmployee201Response struct {
	Headers CreateEmployee201ResponseHeaders
}

func (CreateEmployee201Response) VisitCreateEmployeeResponse

func (response CreateEmployee201Response) VisitCreateEmployeeResponse(w http.ResponseWriter) error

type CreateEmployee201ResponseHeaders

type CreateEmployee201ResponseHeaders struct {
	Location string
}

type CreateEmployee401JSONResponse

type CreateEmployee401JSONResponse struct{ UnauthorizedJSONResponse }

func (CreateEmployee401JSONResponse) VisitCreateEmployeeResponse

func (response CreateEmployee401JSONResponse) VisitCreateEmployeeResponse(w http.ResponseWriter) error

type CreateEmployee422JSONResponse

type CreateEmployee422JSONResponse struct{ ValidationErrorJSONResponse }

func (CreateEmployee422JSONResponse) VisitCreateEmployeeResponse

func (response CreateEmployee422JSONResponse) VisitCreateEmployeeResponse(w http.ResponseWriter) error

type CreateEmployeeJSONBody

type CreateEmployeeJSONBody struct {
	EmployeeName string `json:"employee_name"`
	JobTitle     string `json:"job_title"`
}

CreateEmployeeJSONBody defines parameters for CreateEmployee.

type CreateEmployeeJSONRequestBody

type CreateEmployeeJSONRequestBody CreateEmployeeJSONBody

CreateEmployeeJSONRequestBody defines body for CreateEmployee for application/json ContentType.

type CreateEmployeeRequestObject

type CreateEmployeeRequestObject struct {
	Body *CreateEmployeeJSONRequestBody
}

type CreateEmployeeResponseObject

type CreateEmployeeResponseObject interface {
	VisitCreateEmployeeResponse(w http.ResponseWriter) error
}

type CreateEmployeedefaultJSONResponse

type CreateEmployeedefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (CreateEmployeedefaultJSONResponse) VisitCreateEmployeeResponse

func (response CreateEmployeedefaultJSONResponse) VisitCreateEmployeeResponse(w http.ResponseWriter) error

type DeleteEmployee204Response

type DeleteEmployee204Response struct {
}

func (DeleteEmployee204Response) VisitDeleteEmployeeResponse

func (response DeleteEmployee204Response) VisitDeleteEmployeeResponse(w http.ResponseWriter) error

type DeleteEmployee401JSONResponse

type DeleteEmployee401JSONResponse struct{ UnauthorizedJSONResponse }

func (DeleteEmployee401JSONResponse) VisitDeleteEmployeeResponse

func (response DeleteEmployee401JSONResponse) VisitDeleteEmployeeResponse(w http.ResponseWriter) error

type DeleteEmployee404JSONResponse

type DeleteEmployee404JSONResponse struct{ NotFoundJSONResponse }

func (DeleteEmployee404JSONResponse) VisitDeleteEmployeeResponse

func (response DeleteEmployee404JSONResponse) VisitDeleteEmployeeResponse(w http.ResponseWriter) error

type DeleteEmployee422JSONResponse

type DeleteEmployee422JSONResponse struct{ ValidationErrorJSONResponse }

func (DeleteEmployee422JSONResponse) VisitDeleteEmployeeResponse

func (response DeleteEmployee422JSONResponse) VisitDeleteEmployeeResponse(w http.ResponseWriter) error

type DeleteEmployeeRequestObject

type DeleteEmployeeRequestObject struct {
	Id int64 `json:"id"`
}

type DeleteEmployeeResponseObject

type DeleteEmployeeResponseObject interface {
	VisitDeleteEmployeeResponse(w http.ResponseWriter) error
}

type DeleteEmployeedefaultJSONResponse

type DeleteEmployeedefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (DeleteEmployeedefaultJSONResponse) VisitDeleteEmployeeResponse

func (response DeleteEmployeedefaultJSONResponse) VisitDeleteEmployeeResponse(w http.ResponseWriter) error

type EchoRouter

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type Employee

type Employee struct {
	EmployeeName   string     `json:"employee_name"`
	Id             int        `json:"id"`
	JobTitle       string     `json:"job_title"`
	LastClockInAt  *time.Time `json:"last_clock_in_at,omitempty"`
	LastClockOutAt *time.Time `json:"last_clock_out_at,omitempty"`
}

Employee defines model for Employee.

type EmployeeClockHistories

type EmployeeClockHistories = []EmployeeClockHistory

EmployeeClockHistories defines model for EmployeeClockHistories.

type EmployeeClockHistory

type EmployeeClockHistory struct {
	ClockInAt           *time.Time `json:"clock_in_at,omitempty"`
	ClockOutAt          *time.Time `json:"clock_out_at,omitempty"`
	EmployeeId          int        `json:"employee_id"`
	Id                  int        `json:"id"`
	WorkDuration        string     `json:"work_duration"`
	WorkDurationMinutes int        `json:"work_duration_minutes"`
}

EmployeeClockHistory defines model for EmployeeClockHistory.

type Employees

type Employees = []Employee

Employees defines model for Employees.

type Error

type Error struct {
	ErrorMessage string `json:"error_message"`
}

Error defines model for Error.

type GetEmployee200JSONResponse

type GetEmployee200JSONResponse Employee

func (GetEmployee200JSONResponse) VisitGetEmployeeResponse

func (response GetEmployee200JSONResponse) VisitGetEmployeeResponse(w http.ResponseWriter) error

type GetEmployee401JSONResponse

type GetEmployee401JSONResponse struct{ UnauthorizedJSONResponse }

func (GetEmployee401JSONResponse) VisitGetEmployeeResponse

func (response GetEmployee401JSONResponse) VisitGetEmployeeResponse(w http.ResponseWriter) error

type GetEmployee404JSONResponse

type GetEmployee404JSONResponse struct{ NotFoundJSONResponse }

func (GetEmployee404JSONResponse) VisitGetEmployeeResponse

func (response GetEmployee404JSONResponse) VisitGetEmployeeResponse(w http.ResponseWriter) error

type GetEmployeeRequestObject

type GetEmployeeRequestObject struct {
	Id int64 `json:"id"`
}

type GetEmployeeResponseObject

type GetEmployeeResponseObject interface {
	VisitGetEmployeeResponse(w http.ResponseWriter) error
}

type GetEmployeedefaultJSONResponse

type GetEmployeedefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (GetEmployeedefaultJSONResponse) VisitGetEmployeeResponse

func (response GetEmployeedefaultJSONResponse) VisitGetEmployeeResponse(w http.ResponseWriter) error

type ListClock200JSONResponse

type ListClock200JSONResponse EmployeeClockHistories

func (ListClock200JSONResponse) VisitListClockResponse

func (response ListClock200JSONResponse) VisitListClockResponse(w http.ResponseWriter) error

type ListClock401JSONResponse

type ListClock401JSONResponse struct{ UnauthorizedJSONResponse }

func (ListClock401JSONResponse) VisitListClockResponse

func (response ListClock401JSONResponse) VisitListClockResponse(w http.ResponseWriter) error

type ListClockRequestObject

type ListClockRequestObject struct {
}

type ListClockResponseObject

type ListClockResponseObject interface {
	VisitListClockResponse(w http.ResponseWriter) error
}

type ListClockdefaultJSONResponse

type ListClockdefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (ListClockdefaultJSONResponse) VisitListClockResponse

func (response ListClockdefaultJSONResponse) VisitListClockResponse(w http.ResponseWriter) error

type ListEmployee200JSONResponse

type ListEmployee200JSONResponse Employees

func (ListEmployee200JSONResponse) VisitListEmployeeResponse

func (response ListEmployee200JSONResponse) VisitListEmployeeResponse(w http.ResponseWriter) error

type ListEmployee401JSONResponse

type ListEmployee401JSONResponse struct{ UnauthorizedJSONResponse }

func (ListEmployee401JSONResponse) VisitListEmployeeResponse

func (response ListEmployee401JSONResponse) VisitListEmployeeResponse(w http.ResponseWriter) error

type ListEmployeeRequestObject

type ListEmployeeRequestObject struct {
}

type ListEmployeeResponseObject

type ListEmployeeResponseObject interface {
	VisitListEmployeeResponse(w http.ResponseWriter) error
}

type ListEmployeedefaultJSONResponse

type ListEmployeedefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (ListEmployeedefaultJSONResponse) VisitListEmployeeResponse

func (response ListEmployeedefaultJSONResponse) VisitListEmployeeResponse(w http.ResponseWriter) error

type NotFound

type NotFound = Error

NotFound defines model for NotFound.

type NotFoundJSONResponse

type NotFoundJSONResponse Error

type PatchEmployee204Response

type PatchEmployee204Response struct {
}

func (PatchEmployee204Response) VisitPatchEmployeeResponse

func (response PatchEmployee204Response) VisitPatchEmployeeResponse(w http.ResponseWriter) error

type PatchEmployee401JSONResponse

type PatchEmployee401JSONResponse struct{ UnauthorizedJSONResponse }

func (PatchEmployee401JSONResponse) VisitPatchEmployeeResponse

func (response PatchEmployee401JSONResponse) VisitPatchEmployeeResponse(w http.ResponseWriter) error

type PatchEmployee404JSONResponse

type PatchEmployee404JSONResponse struct{ NotFoundJSONResponse }

func (PatchEmployee404JSONResponse) VisitPatchEmployeeResponse

func (response PatchEmployee404JSONResponse) VisitPatchEmployeeResponse(w http.ResponseWriter) error

type PatchEmployee422JSONResponse

type PatchEmployee422JSONResponse struct{ ValidationErrorJSONResponse }

func (PatchEmployee422JSONResponse) VisitPatchEmployeeResponse

func (response PatchEmployee422JSONResponse) VisitPatchEmployeeResponse(w http.ResponseWriter) error

type PatchEmployeeJSONRequestBody

type PatchEmployeeJSONRequestBody = Employee

PatchEmployeeJSONRequestBody defines body for PatchEmployee for application/json ContentType.

type PatchEmployeeRequestObject

type PatchEmployeeRequestObject struct {
	Id   int64 `json:"id"`
	Body *PatchEmployeeJSONRequestBody
}

type PatchEmployeeResponseObject

type PatchEmployeeResponseObject interface {
	VisitPatchEmployeeResponse(w http.ResponseWriter) error
}

type PatchEmployeedefaultJSONResponse

type PatchEmployeedefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (PatchEmployeedefaultJSONResponse) VisitPatchEmployeeResponse

func (response PatchEmployeedefaultJSONResponse) VisitPatchEmployeeResponse(w http.ResponseWriter) error

type ServerInterface

type ServerInterface interface {
	// Employee start to work
	// (POST /clock-in)
	ClockIn(ctx echo.Context) error
	// Employee stop to work
	// (POST /clock-out)
	ClockOut(ctx echo.Context) error
	// Get employee clock history
	// (GET /clocks)
	ListClock(ctx echo.Context) error
	// Returns a list of employee.
	// (GET /employees)
	ListEmployee(ctx echo.Context) error
	// Create new employee
	// (POST /employees)
	CreateEmployee(ctx echo.Context) error
	// Delete employee by ID
	// (DELETE /employees/{id})
	DeleteEmployee(ctx echo.Context, id int64) error
	// Get employee by ID
	// (GET /employees/{id})
	GetEmployee(ctx echo.Context, id int64) error
	// Partially update employee
	// (PATCH /employees/{id})
	PatchEmployee(ctx echo.Context, id int64) error
	// Update employee
	// (PUT /employees/{id})
	UpdateEmployee(ctx echo.Context, id int64) error
}

ServerInterface represents all server handlers.

func NewStrictHandler

func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) ClockIn

func (w *ServerInterfaceWrapper) ClockIn(ctx echo.Context) error

ClockIn converts echo context to params.

func (*ServerInterfaceWrapper) ClockOut

func (w *ServerInterfaceWrapper) ClockOut(ctx echo.Context) error

ClockOut converts echo context to params.

func (*ServerInterfaceWrapper) CreateEmployee

func (w *ServerInterfaceWrapper) CreateEmployee(ctx echo.Context) error

CreateEmployee converts echo context to params.

func (*ServerInterfaceWrapper) DeleteEmployee

func (w *ServerInterfaceWrapper) DeleteEmployee(ctx echo.Context) error

DeleteEmployee converts echo context to params.

func (*ServerInterfaceWrapper) GetEmployee

func (w *ServerInterfaceWrapper) GetEmployee(ctx echo.Context) error

GetEmployee converts echo context to params.

func (*ServerInterfaceWrapper) ListClock

func (w *ServerInterfaceWrapper) ListClock(ctx echo.Context) error

ListClock converts echo context to params.

func (*ServerInterfaceWrapper) ListEmployee

func (w *ServerInterfaceWrapper) ListEmployee(ctx echo.Context) error

ListEmployee converts echo context to params.

func (*ServerInterfaceWrapper) PatchEmployee

func (w *ServerInterfaceWrapper) PatchEmployee(ctx echo.Context) error

PatchEmployee converts echo context to params.

func (*ServerInterfaceWrapper) UpdateEmployee

func (w *ServerInterfaceWrapper) UpdateEmployee(ctx echo.Context) error

UpdateEmployee converts echo context to params.

type StrictHandlerFunc

type StrictHandlerFunc = strictecho.StrictEchoHandlerFunc

type StrictMiddlewareFunc

type StrictMiddlewareFunc = strictecho.StrictEchoMiddlewareFunc

type StrictServerInterface

type StrictServerInterface interface {
	// Employee start to work
	// (POST /clock-in)
	ClockIn(ctx context.Context, request ClockInRequestObject) (ClockInResponseObject, error)
	// Employee stop to work
	// (POST /clock-out)
	ClockOut(ctx context.Context, request ClockOutRequestObject) (ClockOutResponseObject, error)
	// Get employee clock history
	// (GET /clocks)
	ListClock(ctx context.Context, request ListClockRequestObject) (ListClockResponseObject, error)
	// Returns a list of employee.
	// (GET /employees)
	ListEmployee(ctx context.Context, request ListEmployeeRequestObject) (ListEmployeeResponseObject, error)
	// Create new employee
	// (POST /employees)
	CreateEmployee(ctx context.Context, request CreateEmployeeRequestObject) (CreateEmployeeResponseObject, error)
	// Delete employee by ID
	// (DELETE /employees/{id})
	DeleteEmployee(ctx context.Context, request DeleteEmployeeRequestObject) (DeleteEmployeeResponseObject, error)
	// Get employee by ID
	// (GET /employees/{id})
	GetEmployee(ctx context.Context, request GetEmployeeRequestObject) (GetEmployeeResponseObject, error)
	// Partially update employee
	// (PATCH /employees/{id})
	PatchEmployee(ctx context.Context, request PatchEmployeeRequestObject) (PatchEmployeeResponseObject, error)
	// Update employee
	// (PUT /employees/{id})
	UpdateEmployee(ctx context.Context, request UpdateEmployeeRequestObject) (UpdateEmployeeResponseObject, error)
}

StrictServerInterface represents all server handlers.

type Unauthorized

type Unauthorized = Error

Unauthorized defines model for Unauthorized.

type UnauthorizedJSONResponse

type UnauthorizedJSONResponse Error

type UnexpectedError

type UnexpectedError = Error

UnexpectedError defines model for UnexpectedError.

type UnexpectedErrorJSONResponse

type UnexpectedErrorJSONResponse Error

type UpdateEmployee204Response

type UpdateEmployee204Response struct {
}

func (UpdateEmployee204Response) VisitUpdateEmployeeResponse

func (response UpdateEmployee204Response) VisitUpdateEmployeeResponse(w http.ResponseWriter) error

type UpdateEmployee401JSONResponse

type UpdateEmployee401JSONResponse struct{ UnauthorizedJSONResponse }

func (UpdateEmployee401JSONResponse) VisitUpdateEmployeeResponse

func (response UpdateEmployee401JSONResponse) VisitUpdateEmployeeResponse(w http.ResponseWriter) error

type UpdateEmployee404JSONResponse

type UpdateEmployee404JSONResponse struct{ NotFoundJSONResponse }

func (UpdateEmployee404JSONResponse) VisitUpdateEmployeeResponse

func (response UpdateEmployee404JSONResponse) VisitUpdateEmployeeResponse(w http.ResponseWriter) error

type UpdateEmployee422JSONResponse

type UpdateEmployee422JSONResponse struct{ ValidationErrorJSONResponse }

func (UpdateEmployee422JSONResponse) VisitUpdateEmployeeResponse

func (response UpdateEmployee422JSONResponse) VisitUpdateEmployeeResponse(w http.ResponseWriter) error

type UpdateEmployeeJSONRequestBody

type UpdateEmployeeJSONRequestBody = Employee

UpdateEmployeeJSONRequestBody defines body for UpdateEmployee for application/json ContentType.

type UpdateEmployeeRequestObject

type UpdateEmployeeRequestObject struct {
	Id   int64 `json:"id"`
	Body *UpdateEmployeeJSONRequestBody
}

type UpdateEmployeeResponseObject

type UpdateEmployeeResponseObject interface {
	VisitUpdateEmployeeResponse(w http.ResponseWriter) error
}

type UpdateEmployeedefaultJSONResponse

type UpdateEmployeedefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (UpdateEmployeedefaultJSONResponse) VisitUpdateEmployeeResponse

func (response UpdateEmployeedefaultJSONResponse) VisitUpdateEmployeeResponse(w http.ResponseWriter) error

type ValidationError

type ValidationError = Error

ValidationError defines model for ValidationError.

type ValidationErrorJSONResponse

type ValidationErrorJSONResponse Error

Jump to

Keyboard shortcuts

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