Documentation
¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.0 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- func NewServer(cfg config.Config, DB *sql.DB) (http.Handler, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RequestLogger(handler http.Handler) http.Handler
- type ChiServerOptions
- type DocumentPayload
- type GetDoc200TexthtmlResponse
- type GetDoc400JSONResponse
- type GetDocRequestObject
- type GetDocResponseObject
- type GetHealthcheck200JSONResponse
- type GetHealthcheckRequestObject
- type GetHealthcheckResponseObject
- type GetOpenapiYaml200ApplicationyamlResponse
- type GetOpenapiYaml400JSONResponse
- type GetOpenapiYamlRequestObject
- type GetOpenapiYamlResponseObject
- type GetSyncProgressResponse
- type GetSyncsProgressDocumentHash200JSONResponse
- type GetSyncsProgressDocumentHash401JSONResponse
- type GetSyncsProgressDocumentHash502JSONResponse
- type GetSyncsProgressDocumentHashParams
- type GetSyncsProgressDocumentHashRequestObject
- type GetSyncsProgressDocumentHashResponseObject
- type GetUsersAuth200JSONResponse
- type GetUsersAuth401JSONResponse
- type GetUsersAuthParams
- type GetUsersAuthRequestObject
- type GetUsersAuthResponseObject
- type HttpMethod
- type HttpPath
- type IP
- type InvalidParamFormatError
- type MiddlewareFunc
- type PostUsersCreate201JSONResponse
- type PostUsersCreate402JSONResponse
- type PostUsersCreateJSONRequestBody
- type PostUsersCreateRequestObject
- type PostUsersCreateResponseObject
- type PutSyncsProgress200JSONResponse
- type PutSyncsProgress401JSONResponse
- type PutSyncsProgressJSONRequestBody
- type PutSyncsProgressParams
- type PutSyncsProgressRequestObject
- type PutSyncsProgressResponseObject
- type RequiredHeaderError
- type RequiredParamError
- type Response
- type Server
- func (s *Server) GetDoc(ctx context.Context, request GetDocRequestObject) (GetDocResponseObject, error)
- func (s *Server) GetHealthcheck(ctx context.Context, request GetHealthcheckRequestObject) (GetHealthcheckResponseObject, error)
- func (s *Server) GetOpenapiYaml(ctx context.Context, request GetOpenapiYamlRequestObject) (GetOpenapiYamlResponseObject, error)
- func (s *Server) GetSyncsProgressDocumentHash(ctx context.Context, request GetSyncsProgressDocumentHashRequestObject) (GetSyncsProgressDocumentHashResponseObject, error)
- func (s *Server) GetUsersAuth(ctx context.Context, request GetUsersAuthRequestObject) (GetUsersAuthResponseObject, error)
- func (s *Server) PostUsersCreate(ctx context.Context, request PostUsersCreateRequestObject) (PostUsersCreateResponseObject, error)
- func (s *Server) PutSyncsProgress(ctx context.Context, request PutSyncsProgressRequestObject) (PutSyncsProgressResponseObject, error)
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) GetDoc(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetHealthcheck(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetOpenapiYaml(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetSyncsProgressDocumentHash(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetUsersAuth(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostUsersCreate(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PutSyncsProgress(w http.ResponseWriter, r *http.Request)
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- func (_ Unimplemented) GetDoc(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GetHealthcheck(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GetOpenapiYaml(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GetSyncsProgressDocumentHash(w http.ResponseWriter, r *http.Request, documentHash string, ...)
- func (_ Unimplemented) GetUsersAuth(w http.ResponseWriter, r *http.Request, params GetUsersAuthParams)
- func (_ Unimplemented) PostUsersCreate(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) PutSyncsProgress(w http.ResponseWriter, r *http.Request, params PutSyncsProgressParams)
- type UnmarshalingParamError
- type UserPayload
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 Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerFromMuxWithBaseURL ¶
func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
Types ¶
type ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type DocumentPayload ¶
type DocumentPayload struct { Device *string `json:"device,omitempty"` DeviceId *string `json:"device_id,omitempty"` Document *string `json:"document,omitempty"` Percentage *float32 `json:"percentage,omitempty"` Progress *string `json:"progress,omitempty"` }
DocumentPayload defines model for DocumentPayload.
type GetDoc200TexthtmlResponse ¶
func (GetDoc200TexthtmlResponse) VisitGetDocResponse ¶
func (response GetDoc200TexthtmlResponse) VisitGetDocResponse(w http.ResponseWriter) error
type GetDoc400JSONResponse ¶
type GetDoc400JSONResponse Response
func (GetDoc400JSONResponse) VisitGetDocResponse ¶
func (response GetDoc400JSONResponse) VisitGetDocResponse(w http.ResponseWriter) error
type GetDocRequestObject ¶
type GetDocRequestObject struct { }
type GetDocResponseObject ¶
type GetDocResponseObject interface {
VisitGetDocResponse(w http.ResponseWriter) error
}
type GetHealthcheck200JSONResponse ¶
type GetHealthcheck200JSONResponse Response
func (GetHealthcheck200JSONResponse) VisitGetHealthcheckResponse ¶
func (response GetHealthcheck200JSONResponse) VisitGetHealthcheckResponse(w http.ResponseWriter) error
type GetHealthcheckRequestObject ¶
type GetHealthcheckRequestObject struct { }
type GetHealthcheckResponseObject ¶
type GetHealthcheckResponseObject interface {
VisitGetHealthcheckResponse(w http.ResponseWriter) error
}
type GetOpenapiYaml200ApplicationyamlResponse ¶
func (GetOpenapiYaml200ApplicationyamlResponse) VisitGetOpenapiYamlResponse ¶
func (response GetOpenapiYaml200ApplicationyamlResponse) VisitGetOpenapiYamlResponse(w http.ResponseWriter) error
type GetOpenapiYaml400JSONResponse ¶
type GetOpenapiYaml400JSONResponse Response
func (GetOpenapiYaml400JSONResponse) VisitGetOpenapiYamlResponse ¶
func (response GetOpenapiYaml400JSONResponse) VisitGetOpenapiYamlResponse(w http.ResponseWriter) error
type GetOpenapiYamlRequestObject ¶
type GetOpenapiYamlRequestObject struct { }
type GetOpenapiYamlResponseObject ¶
type GetOpenapiYamlResponseObject interface {
VisitGetOpenapiYamlResponse(w http.ResponseWriter) error
}
type GetSyncProgressResponse ¶
type GetSyncProgressResponse struct { Device *string `json:"device,omitempty"` DeviceId *string `json:"device_id,omitempty"` Document *string `json:"document,omitempty"` Percentage *float32 `json:"percentage,omitempty"` Progress *string `json:"progress,omitempty"` }
GetSyncProgressResponse defines model for GetSyncProgressResponse.
type GetSyncsProgressDocumentHash200JSONResponse ¶
type GetSyncsProgressDocumentHash200JSONResponse GetSyncProgressResponse
func (GetSyncsProgressDocumentHash200JSONResponse) VisitGetSyncsProgressDocumentHashResponse ¶
func (response GetSyncsProgressDocumentHash200JSONResponse) VisitGetSyncsProgressDocumentHashResponse(w http.ResponseWriter) error
type GetSyncsProgressDocumentHash401JSONResponse ¶
type GetSyncsProgressDocumentHash401JSONResponse Response
func (GetSyncsProgressDocumentHash401JSONResponse) VisitGetSyncsProgressDocumentHashResponse ¶
func (response GetSyncsProgressDocumentHash401JSONResponse) VisitGetSyncsProgressDocumentHashResponse(w http.ResponseWriter) error
type GetSyncsProgressDocumentHash502JSONResponse ¶
type GetSyncsProgressDocumentHash502JSONResponse Response
func (GetSyncsProgressDocumentHash502JSONResponse) VisitGetSyncsProgressDocumentHashResponse ¶
func (response GetSyncsProgressDocumentHash502JSONResponse) VisitGetSyncsProgressDocumentHashResponse(w http.ResponseWriter) error
type GetSyncsProgressDocumentHashParams ¶
type GetSyncsProgressDocumentHashParams struct { XAuthUser string `json:"x-auth-user"` XAuthKey string `json:"x-auth-key"` }
GetSyncsProgressDocumentHashParams defines parameters for GetSyncsProgressDocumentHash.
type GetSyncsProgressDocumentHashRequestObject ¶
type GetSyncsProgressDocumentHashRequestObject struct { DocumentHash string `json:"documentHash,omitempty"` Params GetSyncsProgressDocumentHashParams }
type GetSyncsProgressDocumentHashResponseObject ¶
type GetSyncsProgressDocumentHashResponseObject interface {
VisitGetSyncsProgressDocumentHashResponse(w http.ResponseWriter) error
}
type GetUsersAuth200JSONResponse ¶
type GetUsersAuth200JSONResponse Response
func (GetUsersAuth200JSONResponse) VisitGetUsersAuthResponse ¶
func (response GetUsersAuth200JSONResponse) VisitGetUsersAuthResponse(w http.ResponseWriter) error
type GetUsersAuth401JSONResponse ¶
type GetUsersAuth401JSONResponse Response
func (GetUsersAuth401JSONResponse) VisitGetUsersAuthResponse ¶
func (response GetUsersAuth401JSONResponse) VisitGetUsersAuthResponse(w http.ResponseWriter) error
type GetUsersAuthParams ¶
type GetUsersAuthParams struct { XAuthUser string `json:"x-auth-user"` XAuthKey string `json:"x-auth-key"` }
GetUsersAuthParams defines parameters for GetUsersAuth.
type GetUsersAuthRequestObject ¶
type GetUsersAuthRequestObject struct {
Params GetUsersAuthParams
}
type GetUsersAuthResponseObject ¶
type GetUsersAuthResponseObject interface {
VisitGetUsersAuthResponse(w http.ResponseWriter) error
}
type HttpMethod ¶
type HttpMethod struct{}
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type PostUsersCreate201JSONResponse ¶
type PostUsersCreate201JSONResponse Response
func (PostUsersCreate201JSONResponse) VisitPostUsersCreateResponse ¶
func (response PostUsersCreate201JSONResponse) VisitPostUsersCreateResponse(w http.ResponseWriter) error
type PostUsersCreate402JSONResponse ¶
type PostUsersCreate402JSONResponse Response
func (PostUsersCreate402JSONResponse) VisitPostUsersCreateResponse ¶
func (response PostUsersCreate402JSONResponse) VisitPostUsersCreateResponse(w http.ResponseWriter) error
type PostUsersCreateJSONRequestBody ¶
type PostUsersCreateJSONRequestBody = UserPayload
PostUsersCreateJSONRequestBody defines body for PostUsersCreate for application/json ContentType.
type PostUsersCreateRequestObject ¶
type PostUsersCreateRequestObject struct {
Body *PostUsersCreateJSONRequestBody
}
type PostUsersCreateResponseObject ¶
type PostUsersCreateResponseObject interface {
VisitPostUsersCreateResponse(w http.ResponseWriter) error
}
type PutSyncsProgress200JSONResponse ¶
type PutSyncsProgress200JSONResponse Response
func (PutSyncsProgress200JSONResponse) VisitPutSyncsProgressResponse ¶
func (response PutSyncsProgress200JSONResponse) VisitPutSyncsProgressResponse(w http.ResponseWriter) error
type PutSyncsProgress401JSONResponse ¶
type PutSyncsProgress401JSONResponse Response
func (PutSyncsProgress401JSONResponse) VisitPutSyncsProgressResponse ¶
func (response PutSyncsProgress401JSONResponse) VisitPutSyncsProgressResponse(w http.ResponseWriter) error
type PutSyncsProgressJSONRequestBody ¶
type PutSyncsProgressJSONRequestBody = DocumentPayload
PutSyncsProgressJSONRequestBody defines body for PutSyncsProgress for application/json ContentType.
type PutSyncsProgressParams ¶
type PutSyncsProgressParams struct { XAuthUser string `json:"x-auth-user"` XAuthKey string `json:"x-auth-key"` }
PutSyncsProgressParams defines parameters for PutSyncsProgress.
type PutSyncsProgressRequestObject ¶
type PutSyncsProgressRequestObject struct { Params PutSyncsProgressParams Body *PutSyncsProgressJSONRequestBody }
type PutSyncsProgressResponseObject ¶
type PutSyncsProgressResponseObject interface {
VisitPutSyncsProgressResponse(w http.ResponseWriter) error
}
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 Response ¶
type Response struct { Message *string `json:"message,omitempty"` UserName *string `json:"userName,omitempty"` }
Response defines model for Response.
type Server ¶
type Server struct { Cfg config.Config UserService service.UserServiceInterface }
func (*Server) GetDoc ¶
func (s *Server) GetDoc(ctx context.Context, request GetDocRequestObject) (GetDocResponseObject, error)
func (*Server) GetHealthcheck ¶
func (s *Server) GetHealthcheck(ctx context.Context, request GetHealthcheckRequestObject) (GetHealthcheckResponseObject, error)
func (*Server) GetOpenapiYaml ¶
func (s *Server) GetOpenapiYaml(ctx context.Context, request GetOpenapiYamlRequestObject) (GetOpenapiYamlResponseObject, error)
func (*Server) GetSyncsProgressDocumentHash ¶
func (s *Server) GetSyncsProgressDocumentHash(ctx context.Context, request GetSyncsProgressDocumentHashRequestObject) (GetSyncsProgressDocumentHashResponseObject, error)
func (*Server) GetUsersAuth ¶
func (s *Server) GetUsersAuth(ctx context.Context, request GetUsersAuthRequestObject) (GetUsersAuthResponseObject, error)
func (*Server) PostUsersCreate ¶
func (s *Server) PostUsersCreate(ctx context.Context, request PostUsersCreateRequestObject) (PostUsersCreateResponseObject, error)
func (*Server) PutSyncsProgress ¶
func (s *Server) PutSyncsProgress(ctx context.Context, request PutSyncsProgressRequestObject) (PutSyncsProgressResponseObject, error)
type ServerInterface ¶
type ServerInterface interface { // (GET /doc) GetDoc(w http.ResponseWriter, r *http.Request) // (GET /healthcheck) GetHealthcheck(w http.ResponseWriter, r *http.Request) // (GET /openapi.yaml) GetOpenapiYaml(w http.ResponseWriter, r *http.Request) // (PUT /syncs/progress) PutSyncsProgress(w http.ResponseWriter, r *http.Request, params PutSyncsProgressParams) // (GET /syncs/progress/{documentHash}) GetSyncsProgressDocumentHash(w http.ResponseWriter, r *http.Request, documentHash string, params GetSyncsProgressDocumentHashParams) // (GET /users/auth) GetUsersAuth(w http.ResponseWriter, r *http.Request, params GetUsersAuthParams) // (POST /users/create) PostUsersCreate(w http.ResponseWriter, r *http.Request) }
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) GetDoc ¶
func (siw *ServerInterfaceWrapper) GetDoc(w http.ResponseWriter, r *http.Request)
GetDoc operation middleware
func (*ServerInterfaceWrapper) GetHealthcheck ¶
func (siw *ServerInterfaceWrapper) GetHealthcheck(w http.ResponseWriter, r *http.Request)
GetHealthcheck operation middleware
func (*ServerInterfaceWrapper) GetOpenapiYaml ¶
func (siw *ServerInterfaceWrapper) GetOpenapiYaml(w http.ResponseWriter, r *http.Request)
GetOpenapiYaml operation middleware
func (*ServerInterfaceWrapper) GetSyncsProgressDocumentHash ¶
func (siw *ServerInterfaceWrapper) GetSyncsProgressDocumentHash(w http.ResponseWriter, r *http.Request)
GetSyncsProgressDocumentHash operation middleware
func (*ServerInterfaceWrapper) GetUsersAuth ¶
func (siw *ServerInterfaceWrapper) GetUsersAuth(w http.ResponseWriter, r *http.Request)
GetUsersAuth operation middleware
func (*ServerInterfaceWrapper) PostUsersCreate ¶
func (siw *ServerInterfaceWrapper) PostUsersCreate(w http.ResponseWriter, r *http.Request)
PostUsersCreate operation middleware
func (*ServerInterfaceWrapper) PutSyncsProgress ¶
func (siw *ServerInterfaceWrapper) PutSyncsProgress(w http.ResponseWriter, r *http.Request)
PutSyncsProgress operation middleware
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 { // (GET /doc) GetDoc(ctx context.Context, request GetDocRequestObject) (GetDocResponseObject, error) // (GET /healthcheck) GetHealthcheck(ctx context.Context, request GetHealthcheckRequestObject) (GetHealthcheckResponseObject, error) // (GET /openapi.yaml) GetOpenapiYaml(ctx context.Context, request GetOpenapiYamlRequestObject) (GetOpenapiYamlResponseObject, error) // (PUT /syncs/progress) PutSyncsProgress(ctx context.Context, request PutSyncsProgressRequestObject) (PutSyncsProgressResponseObject, error) // (GET /syncs/progress/{documentHash}) GetSyncsProgressDocumentHash(ctx context.Context, request GetSyncsProgressDocumentHashRequestObject) (GetSyncsProgressDocumentHashResponseObject, error) // (GET /users/auth) GetUsersAuth(ctx context.Context, request GetUsersAuthRequestObject) (GetUsersAuthResponseObject, error) // (POST /users/create) PostUsersCreate(ctx context.Context, request PostUsersCreateRequestObject) (PostUsersCreateResponseObject, error) }
StrictServerInterface represents all server handlers.
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 Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) GetDoc ¶
func (_ Unimplemented) GetDoc(w http.ResponseWriter, r *http.Request)
(GET /doc)
func (Unimplemented) GetHealthcheck ¶
func (_ Unimplemented) GetHealthcheck(w http.ResponseWriter, r *http.Request)
(GET /healthcheck)
func (Unimplemented) GetOpenapiYaml ¶
func (_ Unimplemented) GetOpenapiYaml(w http.ResponseWriter, r *http.Request)
(GET /openapi.yaml)
func (Unimplemented) GetSyncsProgressDocumentHash ¶
func (_ Unimplemented) GetSyncsProgressDocumentHash(w http.ResponseWriter, r *http.Request, documentHash string, params GetSyncsProgressDocumentHashParams)
(GET /syncs/progress/{documentHash})
func (Unimplemented) GetUsersAuth ¶
func (_ Unimplemented) GetUsersAuth(w http.ResponseWriter, r *http.Request, params GetUsersAuthParams)
(GET /users/auth)
func (Unimplemented) PostUsersCreate ¶
func (_ Unimplemented) PostUsersCreate(w http.ResponseWriter, r *http.Request)
(POST /users/create)
func (Unimplemented) PutSyncsProgress ¶
func (_ Unimplemented) PutSyncsProgress(w http.ResponseWriter, r *http.Request, params PutSyncsProgressParams)
(PUT /syncs/progress)
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error
type UserPayload ¶
type UserPayload struct { Password *string `json:"password,omitempty"` Username *string `json:"username,omitempty"` }
UserPayload defines model for UserPayload.