124 lines
3.9 KiB
Go
124 lines
3.9 KiB
Go
// Code generated by ogen, DO NOT EDIT.
|
|
|
|
package rest
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// Handler handles operations described by OpenAPI v3 specification.
|
|
type Handler interface {
|
|
// CancelDatasetJob implements cancelDatasetJob operation.
|
|
//
|
|
// Cancel a running download job.
|
|
//
|
|
// DELETE /api/v1/admin/jobs/{id}
|
|
CancelDatasetJob(ctx context.Context, params CancelDatasetJobParams) error
|
|
// CancelPredictionJob implements cancelPredictionJob operation.
|
|
//
|
|
// Cancel a queued prediction job.
|
|
//
|
|
// DELETE /api/v1/predictions/{id}
|
|
CancelPredictionJob(ctx context.Context, params CancelPredictionJobParams) error
|
|
// CreatePredictionJob implements createPredictionJob operation.
|
|
//
|
|
// Enqueue an asynchronous prediction.
|
|
//
|
|
// POST /api/v1/predictions
|
|
CreatePredictionJob(ctx context.Context, req *PredictionV2Request) (*PredictionJob, error)
|
|
// DeleteDataset implements deleteDataset operation.
|
|
//
|
|
// Delete a stored dataset by filename.
|
|
//
|
|
// DELETE /api/v1/admin/datasets/{name}
|
|
DeleteDataset(ctx context.Context, params DeleteDatasetParams) error
|
|
// GetDatasetJob implements getDatasetJob operation.
|
|
//
|
|
// Get a dataset download job.
|
|
//
|
|
// GET /api/v1/admin/jobs/{id}
|
|
GetDatasetJob(ctx context.Context, params GetDatasetJobParams) (*DownloadJob, error)
|
|
// GetPredictionJob implements getPredictionJob operation.
|
|
//
|
|
// Poll an asynchronous prediction job.
|
|
//
|
|
// GET /api/v1/predictions/{id}
|
|
GetPredictionJob(ctx context.Context, params GetPredictionJobParams) (*PredictionJob, error)
|
|
// GetServiceStatus implements getServiceStatus operation.
|
|
//
|
|
// Service status summary.
|
|
//
|
|
// GET /api/v1/admin/status
|
|
GetServiceStatus(ctx context.Context) (*StatusResponse, error)
|
|
// GetWindField implements getWindField operation.
|
|
//
|
|
// Wind-field velocity grid (leaflet-velocity / wind-layer format).
|
|
//
|
|
// GET /api/v1/wind/field
|
|
GetWindField(ctx context.Context, params GetWindFieldParams) ([]WindComponent, error)
|
|
// GetWindMeta implements getWindMeta operation.
|
|
//
|
|
// Wind-field visualization metadata.
|
|
//
|
|
// GET /api/v1/wind/meta
|
|
GetWindMeta(ctx context.Context) (*WindMeta, error)
|
|
// ListDatasetJobs implements listDatasetJobs operation.
|
|
//
|
|
// List dataset download jobs.
|
|
//
|
|
// GET /api/v1/admin/jobs
|
|
ListDatasetJobs(ctx context.Context) ([]DownloadJob, error)
|
|
// ListDatasets implements listDatasets operation.
|
|
//
|
|
// List stored datasets.
|
|
//
|
|
// GET /api/v1/admin/datasets
|
|
ListDatasets(ctx context.Context) (*DatasetList, error)
|
|
// PerformPrediction implements performPrediction operation.
|
|
//
|
|
// Tawhiri-compatible prediction.
|
|
//
|
|
// GET /api/v1/prediction
|
|
PerformPrediction(ctx context.Context, params PerformPredictionParams) (*PredictionResponse, error)
|
|
// PerformPredictionV2 implements performPredictionV2 operation.
|
|
//
|
|
// Profile-driven prediction (synchronous).
|
|
//
|
|
// POST /api/v2/prediction
|
|
PerformPredictionV2(ctx context.Context, req *PredictionV2Request) (*PredictionV2Response, error)
|
|
// ReadinessCheck implements readinessCheck operation.
|
|
//
|
|
// Readiness check.
|
|
//
|
|
// GET /ready
|
|
ReadinessCheck(ctx context.Context) (*ReadinessResponse, error)
|
|
// TriggerDatasetDownload implements triggerDatasetDownload operation.
|
|
//
|
|
// Trigger a dataset download.
|
|
//
|
|
// POST /api/v1/admin/datasets
|
|
TriggerDatasetDownload(ctx context.Context, req *DownloadRequest) (*DownloadAccepted, error)
|
|
// NewError creates *DefaultErrorStatusCode from error returned by handler.
|
|
//
|
|
// Used for common default response.
|
|
NewError(ctx context.Context, err error) *DefaultErrorStatusCode
|
|
}
|
|
|
|
// Server implements http server based on OpenAPI v3 specification and
|
|
// calls Handler to handle requests.
|
|
type Server struct {
|
|
h Handler
|
|
baseServer
|
|
}
|
|
|
|
// NewServer creates new Server.
|
|
func NewServer(h Handler, opts ...ServerOption) (*Server, error) {
|
|
s, err := newServerConfig(opts...).baseServer()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &Server{
|
|
h: h,
|
|
baseServer: s,
|
|
}, nil
|
|
}
|