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.5.1 DO NOT EDIT.
Collect type-safe template types
Index ¶
- Constants
- func GetSwagger() (swagger *openapi3.T, err error)
- func NewServer(api *ServerHandler, port uint, scicatUrl string) (*http.Server, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router gin.IRouter, si ServerInterface)
- func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)
- func ScicatTokenAuthMiddleware(scicatUrl string) openapi3filter.AuthenticationFunc
- type DeleteTransferTask200Response
- type DeleteTransferTask400JSONResponse
- type DeleteTransferTask401JSONResponse
- type DeleteTransferTask403JSONResponse
- type DeleteTransferTask500JSONResponse
- type DeleteTransferTaskParams
- type DeleteTransferTaskRequestObject
- type DeleteTransferTaskResponseObject
- type Facility
- type FileToTransfer
- type GeneralErrorResponse
- type GeneralErrorResponseJSONResponse
- type GetVersion200JSONResponse
- type GetVersionRequestObject
- type GetVersionResponseObject
- type GinServerOptions
- type MiddlewareFunc
- type PostTransferTask200JSONResponse
- type PostTransferTask400JSONResponse
- type PostTransferTask401JSONResponse
- type PostTransferTask403JSONResponse
- type PostTransferTask500JSONResponse
- type PostTransferTask503JSONResponse
- type PostTransferTaskJSONBody
- type PostTransferTaskJSONRequestBody
- type PostTransferTaskParams
- type PostTransferTaskRequestObject
- type PostTransferTaskResponseObject
- type ServerHandler
- func (s ServerHandler) DeleteTransferTask(ctx context.Context, req DeleteTransferTaskRequestObject) (DeleteTransferTaskResponseObject, error)
- func (s ServerHandler) GetVersion(ctx context.Context, request GetVersionRequestObject) (GetVersionResponseObject, error)
- func (s ServerHandler) PostTransferTask(ctx context.Context, request PostTransferTaskRequestObject) (PostTransferTaskResponseObject, error)
- type ServerInterface
- type ServerInterfaceWrapper
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
Constants ¶
const SCICAT_AUTH_HEADER = "SciCat-API-Key"
HTTP header to specify SciCat API key
const (
ScicatKeyAuthScopes = "ScicatKeyAuth.Scopes"
)
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.IRouter, si ServerInterface)
RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
func RegisterHandlersWithOptions ¶
func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)
RegisterHandlersWithOptions creates http.Handler with additional options
func ScicatTokenAuthMiddleware ¶
func ScicatTokenAuthMiddleware(scicatUrl string) openapi3filter.AuthenticationFunc
Types ¶
type DeleteTransferTask200Response ¶
type DeleteTransferTask200Response struct {
}
func (DeleteTransferTask200Response) VisitDeleteTransferTaskResponse ¶
func (response DeleteTransferTask200Response) VisitDeleteTransferTaskResponse(w http.ResponseWriter) error
type DeleteTransferTask400JSONResponse ¶
type DeleteTransferTask400JSONResponse struct {
GeneralErrorResponseJSONResponse
}
func (DeleteTransferTask400JSONResponse) VisitDeleteTransferTaskResponse ¶
func (response DeleteTransferTask400JSONResponse) VisitDeleteTransferTaskResponse(w http.ResponseWriter) error
type DeleteTransferTask401JSONResponse ¶
type DeleteTransferTask401JSONResponse struct {
// Details further details, debugging information
Details *string `json:"details,omitempty"`
// Message the error message
Message *string `json:"message,omitempty"`
}
func (DeleteTransferTask401JSONResponse) VisitDeleteTransferTaskResponse ¶
func (response DeleteTransferTask401JSONResponse) VisitDeleteTransferTaskResponse(w http.ResponseWriter) error
type DeleteTransferTask403JSONResponse ¶
type DeleteTransferTask403JSONResponse struct {
// Details further details, debugging information
Details *string `json:"details,omitempty"`
// Message the error message
Message *string `json:"message,omitempty"`
}
func (DeleteTransferTask403JSONResponse) VisitDeleteTransferTaskResponse ¶
func (response DeleteTransferTask403JSONResponse) VisitDeleteTransferTaskResponse(w http.ResponseWriter) error
type DeleteTransferTask500JSONResponse ¶
type DeleteTransferTask500JSONResponse struct {
// Details further details, debugging information
Details *string `json:"details,omitempty"`
// Message the error message
Message *string `json:"message,omitempty"`
}
func (DeleteTransferTask500JSONResponse) VisitDeleteTransferTaskResponse ¶
func (response DeleteTransferTask500JSONResponse) VisitDeleteTransferTaskResponse(w http.ResponseWriter) error
type DeleteTransferTaskParams ¶
type DeleteTransferTaskParams struct {
// Delete Enables/disables deleting from scicat job system. By default, it's disabled (false).
Delete *bool `form:"delete,omitempty" json:"delete,omitempty"`
}
DeleteTransferTaskParams defines parameters for DeleteTransferTask.
type DeleteTransferTaskRequestObject ¶
type DeleteTransferTaskRequestObject struct {
ScicatJobId string `json:"scicatJobId"`
Params DeleteTransferTaskParams
}
type DeleteTransferTaskResponseObject ¶
type DeleteTransferTaskResponseObject interface {
VisitDeleteTransferTaskResponse(w http.ResponseWriter) error
}
type Facility ¶
type Facility struct {
Name string
Collection string
AccessPath *accessPathTemplate
AccessValue *accessPathTemplate
Direction config.FacilityDirection
SourcePath *facilityPathTemplate
DestinationPath *facilityPathTemplate
}
func NewFacility ¶
func NewFacility(config config.FacilityConfig) (*Facility, error)
type FileToTransfer ¶
type FileToTransfer struct {
// IsSymlink specifies whether this file is a symlink
IsSymlink bool `json:"isSymlink"`
// Path the path of the file, it has to be relative to the dataset source folder
Path string `json:"path"`
}
FileToTransfer the file to transfer as part of a transfer request
type GeneralErrorResponse ¶
type GeneralErrorResponse struct {
// Details further details, debugging information
Details *string `json:"details,omitempty"`
// Message the error message
Message *string `json:"message,omitempty"`
}
GeneralErrorResponse defines model for GeneralErrorResponse.
type GetVersion200JSONResponse ¶
type GetVersion200JSONResponse struct {
// Version the current version of the service
Version string `json:"version"`
}
func (GetVersion200JSONResponse) VisitGetVersionResponse ¶
func (response GetVersion200JSONResponse) VisitGetVersionResponse(w http.ResponseWriter) error
type GetVersionRequestObject ¶
type GetVersionRequestObject struct {
}
type GetVersionResponseObject ¶
type GetVersionResponseObject interface {
VisitGetVersionResponse(w http.ResponseWriter) error
}
type GinServerOptions ¶
type GinServerOptions struct {
BaseURL string
Middlewares []MiddlewareFunc
ErrorHandler func(*gin.Context, error, int)
}
GinServerOptions provides options for the Gin server.
type MiddlewareFunc ¶
type PostTransferTask200JSONResponse ¶
type PostTransferTask200JSONResponse struct {
// JobId the SciCat job id of the transfer job
JobId string `json:"jobId"`
}
func (PostTransferTask200JSONResponse) VisitPostTransferTaskResponse ¶
func (response PostTransferTask200JSONResponse) VisitPostTransferTaskResponse(w http.ResponseWriter) error
type PostTransferTask400JSONResponse ¶
type PostTransferTask400JSONResponse struct {
GeneralErrorResponseJSONResponse
}
func (PostTransferTask400JSONResponse) VisitPostTransferTaskResponse ¶
func (response PostTransferTask400JSONResponse) VisitPostTransferTaskResponse(w http.ResponseWriter) error
type PostTransferTask401JSONResponse ¶
type PostTransferTask401JSONResponse struct {
// Details further details, debugging information
Details *string `json:"details,omitempty"`
// Message the error message
Message *string `json:"message,omitempty"`
}
func (PostTransferTask401JSONResponse) VisitPostTransferTaskResponse ¶
func (response PostTransferTask401JSONResponse) VisitPostTransferTaskResponse(w http.ResponseWriter) error
type PostTransferTask403JSONResponse ¶
type PostTransferTask403JSONResponse struct {
// Details further details, debugging information
Details *string `json:"details,omitempty"`
// Message the error message
Message *string `json:"message,omitempty"`
}
func (PostTransferTask403JSONResponse) VisitPostTransferTaskResponse ¶
func (response PostTransferTask403JSONResponse) VisitPostTransferTaskResponse(w http.ResponseWriter) error
type PostTransferTask500JSONResponse ¶
type PostTransferTask500JSONResponse struct {
// Details further details, debugging information
Details *string `json:"details,omitempty"`
// Message the error message
Message *string `json:"message,omitempty"`
}
func (PostTransferTask500JSONResponse) VisitPostTransferTaskResponse ¶
func (response PostTransferTask500JSONResponse) VisitPostTransferTaskResponse(w http.ResponseWriter) error
type PostTransferTask503JSONResponse ¶
type PostTransferTask503JSONResponse struct {
// Details further details, debugging information
Details *string `json:"details,omitempty"`
// Message the error message
Message *string `json:"message,omitempty"`
}
func (PostTransferTask503JSONResponse) VisitPostTransferTaskResponse ¶
func (response PostTransferTask503JSONResponse) VisitPostTransferTaskResponse(w http.ResponseWriter) error
type PostTransferTaskJSONBody ¶
type PostTransferTaskJSONBody struct {
FileList *[]FileToTransfer `json:"fileList,omitempty"`
}
PostTransferTaskJSONBody defines parameters for PostTransferTask.
type PostTransferTaskJSONRequestBody ¶
type PostTransferTaskJSONRequestBody PostTransferTaskJSONBody
PostTransferTaskJSONRequestBody defines body for PostTransferTask for application/json ContentType.
type PostTransferTaskParams ¶
type PostTransferTaskParams struct {
// SourceFacility the identifier name of the source facility
SourceFacility string `form:"sourceFacility" json:"sourceFacility"`
// DestFacility the path in the destination collection to use for the transfer
DestFacility string `form:"destFacility" json:"destFacility"`
// ScicatPid the pid of the dataset being transferred
ScicatPid string `form:"scicatPid" json:"scicatPid"`
// CollectionRootPath Path to the root of the globus collection on the source facility
CollectionRootPath string `form:"collectionRootPath" json:"collectionRootPath"`
}
PostTransferTaskParams defines parameters for PostTransferTask.
type PostTransferTaskRequestObject ¶
type PostTransferTaskRequestObject struct {
Params PostTransferTaskParams
Body *PostTransferTaskJSONRequestBody
}
type PostTransferTaskResponseObject ¶
type PostTransferTaskResponseObject interface {
VisitPostTransferTaskResponse(w http.ResponseWriter) error
}
type ServerHandler ¶
type ServerHandler struct {
// contains filtered or unexported fields
}
func NewServerHandler ¶
func NewServerHandler( version string, globusClient globus.GlobusClient, scicatUrl string, scicatServiceUser serviceuser.ScicatServiceUser, facilities *map[string]Facility, taskPool tasks.TaskPool) (ServerHandler, error)
func (ServerHandler) DeleteTransferTask ¶
func (s ServerHandler) DeleteTransferTask(ctx context.Context, req DeleteTransferTaskRequestObject) (DeleteTransferTaskResponseObject, error)
func (ServerHandler) GetVersion ¶
func (s ServerHandler) GetVersion(ctx context.Context, request GetVersionRequestObject) (GetVersionResponseObject, error)
func (ServerHandler) PostTransferTask ¶
func (s ServerHandler) PostTransferTask(ctx context.Context, request PostTransferTaskRequestObject) (PostTransferTaskResponseObject, error)
type ServerInterface ¶
type ServerInterface interface {
// request a transfer task
// (POST /transfer)
PostTransferTask(c *gin.Context, params PostTransferTaskParams)
// cancels and/or deletes transfer entry
// (DELETE /transfer/{scicatJobId})
DeleteTransferTask(c *gin.Context, scicatJobId string, params DeleteTransferTaskParams)
// get SciCat Globus Proxy version
// (GET /version)
GetVersion(c *gin.Context)
}
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandler func(*gin.Context, error, int)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) DeleteTransferTask ¶
func (siw *ServerInterfaceWrapper) DeleteTransferTask(c *gin.Context)
DeleteTransferTask operation middleware
func (*ServerInterfaceWrapper) GetVersion ¶
func (siw *ServerInterfaceWrapper) GetVersion(c *gin.Context)
GetVersion operation middleware
func (*ServerInterfaceWrapper) PostTransferTask ¶
func (siw *ServerInterfaceWrapper) PostTransferTask(c *gin.Context)
PostTransferTask operation middleware
type StrictHandlerFunc ¶
type StrictHandlerFunc = strictgin.StrictGinHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = strictgin.StrictGinMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// request a transfer task
// (POST /transfer)
PostTransferTask(ctx context.Context, request PostTransferTaskRequestObject) (PostTransferTaskResponseObject, error)
// cancels and/or deletes transfer entry
// (DELETE /transfer/{scicatJobId})
DeleteTransferTask(ctx context.Context, request DeleteTransferTaskRequestObject) (DeleteTransferTaskResponseObject, error)
// get SciCat Globus Proxy version
// (GET /version)
GetVersion(ctx context.Context, request GetVersionRequestObject) (GetVersionResponseObject, error)
}
StrictServerInterface represents all server handlers.