Documentation ¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.1-0.20240519200907-da9077bb5ffe DO NOT EDIT.
Index ¶
- 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
- type API
- func (a *API) GetEnvs(w http.ResponseWriter, _ *http.Request)
- func (a *API) GetFiles(w http.ResponseWriter, r *http.Request, params GetFilesParams)
- func (a *API) GetHealth(w http.ResponseWriter, r *http.Request)
- func (a *API) GetMetrics(w http.ResponseWriter, r *http.Request)
- func (a *API) PostFiles(w http.ResponseWriter, r *http.Request, params PostFilesParams)
- func (a *API) PostInit(w http.ResponseWriter, r *http.Request)
- type ChiServerOptions
- type EntryInfo
- type EntryInfoType
- type EnvVars
- type Error
- type FileNotFound
- type FilePath
- type GetFilesParams
- type InternalServerError
- type InvalidParamFormatError
- type InvalidPath
- type InvalidUser
- type MiddlewareFunc
- type NotEnoughDiskSpace
- type PostFilesMultipartBody
- type PostFilesMultipartRequestBody
- type PostFilesParams
- type PostInitJSONBody
- type PostInitJSONRequestBody
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) GetEnvs(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetFiles(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetMetrics(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostFiles(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostInit(w http.ResponseWriter, r *http.Request)
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- func (_ Unimplemented) GetEnvs(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GetFiles(w http.ResponseWriter, r *http.Request, params GetFilesParams)
- func (_ Unimplemented) GetHealth(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GetMetrics(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) PostFiles(w http.ResponseWriter, r *http.Request, params PostFilesParams)
- func (_ Unimplemented) PostInit(w http.ResponseWriter, r *http.Request)
- type UnmarshalingParamError
- type UploadSuccess
- type User
Constants ¶
This section is empty.
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, 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
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) GetFiles ¶
func (a *API) GetFiles(w http.ResponseWriter, r *http.Request, params GetFilesParams)
func (*API) GetMetrics ¶
func (a *API) GetMetrics(w http.ResponseWriter, r *http.Request)
func (*API) PostFiles ¶
func (a *API) PostFiles(w http.ResponseWriter, r *http.Request, params PostFilesParams)
type ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type EntryInfo ¶
type EntryInfo struct { // Name Name of the file Name string `json:"name"` // Path Path to the file Path string `json:"path"` // Type Type of the file Type EntryInfoType `json:"type"` }
EntryInfo defines model for EntryInfo.
type EntryInfoType ¶
type EntryInfoType string
EntryInfoType Type of the file
const (
File EntryInfoType = "file"
)
Defines values for EntryInfoType.
type Error ¶
type Error struct { // Code Error code Code int `json:"code"` // Message Error message Message string `json:"message"` }
Error defines model for Error.
type GetFilesParams ¶
type GetFilesParams struct { // Path Path to the file, URL encoded. Can be relative to user's home directory. Path *FilePath `form:"path,omitempty" json:"path,omitempty"` // Username User used for setting the owner, or resolving relative paths. Username User `form:"username" json:"username"` }
GetFilesParams defines parameters for GetFiles.
type InternalServerError ¶
type InternalServerError = Error
InternalServerError defines model for InternalServerError.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type NotEnoughDiskSpace ¶
type NotEnoughDiskSpace = Error
NotEnoughDiskSpace defines model for NotEnoughDiskSpace.
type PostFilesMultipartBody ¶
type PostFilesMultipartBody struct {
File *openapi_types.File `json:"file,omitempty"`
}
PostFilesMultipartBody defines parameters for PostFiles.
type PostFilesMultipartRequestBody ¶
type PostFilesMultipartRequestBody PostFilesMultipartBody
PostFilesMultipartRequestBody defines body for PostFiles for multipart/form-data ContentType.
type PostFilesParams ¶
type PostFilesParams struct { // Path Path to the file, URL encoded. Can be relative to user's home directory. Path *FilePath `form:"path,omitempty" json:"path,omitempty"` // Username User used for setting the owner, or resolving relative paths. Username User `form:"username" json:"username"` }
PostFilesParams defines parameters for PostFiles.
type PostInitJSONBody ¶
type PostInitJSONBody struct { // EnvVars Environment variables to set EnvVars *EnvVars `json:"envVars,omitempty"` }
PostInitJSONBody defines parameters for PostInit.
type PostInitJSONRequestBody ¶
type PostInitJSONRequestBody PostInitJSONBody
PostInitJSONRequestBody defines body for PostInit for application/json ContentType.
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 { // Get the environment variables // (GET /envs) GetEnvs(w http.ResponseWriter, r *http.Request) // Download a file // (GET /files) GetFiles(w http.ResponseWriter, r *http.Request, params GetFilesParams) // Upload a file and ensure the parent directories exist. If the file exists, it will be overwritten. // (POST /files) PostFiles(w http.ResponseWriter, r *http.Request, params PostFilesParams) // Check the health of the service // (GET /health) GetHealth(w http.ResponseWriter, r *http.Request) // Set env vars, ensure the time and metadata is synced with the host // (POST /init) PostInit(w http.ResponseWriter, r *http.Request) // Get the stats of the service // (GET /metrics) GetMetrics(w http.ResponseWriter, r *http.Request) }
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) GetEnvs ¶
func (siw *ServerInterfaceWrapper) GetEnvs(w http.ResponseWriter, r *http.Request)
GetEnvs operation middleware
func (*ServerInterfaceWrapper) GetFiles ¶
func (siw *ServerInterfaceWrapper) GetFiles(w http.ResponseWriter, r *http.Request)
GetFiles operation middleware
func (*ServerInterfaceWrapper) GetHealth ¶
func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Request)
GetHealth operation middleware
func (*ServerInterfaceWrapper) GetMetrics ¶
func (siw *ServerInterfaceWrapper) GetMetrics(w http.ResponseWriter, r *http.Request)
GetMetrics operation middleware
func (*ServerInterfaceWrapper) PostFiles ¶
func (siw *ServerInterfaceWrapper) PostFiles(w http.ResponseWriter, r *http.Request)
PostFiles operation middleware
func (*ServerInterfaceWrapper) PostInit ¶
func (siw *ServerInterfaceWrapper) PostInit(w http.ResponseWriter, r *http.Request)
PostInit operation middleware
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) GetEnvs ¶
func (_ Unimplemented) GetEnvs(w http.ResponseWriter, r *http.Request)
Get the environment variables (GET /envs)
func (Unimplemented) GetFiles ¶
func (_ Unimplemented) GetFiles(w http.ResponseWriter, r *http.Request, params GetFilesParams)
Download a file (GET /files)
func (Unimplemented) GetHealth ¶
func (_ Unimplemented) GetHealth(w http.ResponseWriter, r *http.Request)
Check the health of the service (GET /health)
func (Unimplemented) GetMetrics ¶
func (_ Unimplemented) GetMetrics(w http.ResponseWriter, r *http.Request)
Get the stats of the service (GET /metrics)
func (Unimplemented) PostFiles ¶
func (_ Unimplemented) PostFiles(w http.ResponseWriter, r *http.Request, params PostFilesParams)
Upload a file and ensure the parent directories exist. If the file exists, it will be overwritten. (POST /files)
func (Unimplemented) PostInit ¶
func (_ Unimplemented) PostInit(w http.ResponseWriter, r *http.Request)
Set env vars, ensure the time and metadata is synced with the host (POST /init)
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error
type UploadSuccess ¶
type UploadSuccess = []EntryInfo
UploadSuccess defines model for UploadSuccess.