diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..082b194 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "makefile.configureOnOpen": false +} \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fef73c5 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +generate-ogen: + go run github.com/ogen-go/ogen/cmd/ogen@latest --target pkg/rest -package gsn --clean api/rest/predictor.swagger.yml \ No newline at end of file diff --git a/api/rest/predictor.swagger.yml b/api/rest/predictor.swagger.yml new file mode 100644 index 0000000..f6a8feb --- /dev/null +++ b/api/rest/predictor.swagger.yml @@ -0,0 +1,71 @@ +openapi: 3.0.4 +info: + title: GSN Predictor - OpenAPI 3.0 + version: 0.0.1 +paths: + /api/v1/prediction: + post: + tags: + - Prediction + summary: Perform preidction + operationId: performPrediction + parameters: + - in: query + name: parameters + required: false + schema: + $ref: '#/components/schemas/Prediction/Parameters' + style: form + explode: true + requestBody: + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/Prediction/Parameters' + +components: + schemas: + Prediction: + Parameters: + type: object + properties: + launch_latitude: # TODO: altitude not required with fallback to https://github.com/priyeshpatel/ruaumoko Go analog + type: number + launch_longitude: + type: number + launch_datetime: + type: string + format: date-time + launch_altitude: + type: number + profile: + type: string + enum: ["standard_profile", "float_profile", "reverse_profile", "custom_profile"] + ascent_rate: + type: number + burst_altitude: + type: number + descent_rate: + type: number + float_altitude: + type: number + stop_datetime: + type: string + format: date-time + ascent_curve: + type: string + description: "Base64 encoded ascent curve" + descent_curve: + type: string + description: "Base64 encoded descent curve" + interpolate: + type: boolean + default: false + format: # TODO: custom output format (csv, kml) with json as default + type: string + enum: ["json"] + default: json + dataset: + type: string + format: date-time \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..af3a3ba --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module git.intra.yksa.space/gsn/predictor + +go 1.24.4