feat: init

This commit is contained in:
Anatoly Antonov 2025-03-26 15:07:12 +03:00 committed by Anatoliy Antonov
parent 7688020b52
commit 6302dd62d6
33 changed files with 6027 additions and 0 deletions

View file

@ -0,0 +1,70 @@
// Code generated by ogen, DO NOT EDIT.
package gsn
import (
"context"
)
// Handler handles operations described by OpenAPI v3 specification.
type Handler interface {
// GetSatellites implements GetSatellites operation.
//
// Get available satellites.
//
// GET /satellite
GetSatellites(ctx context.Context) (*GetSatellitesOK, error)
// GetStations implements GetStations operation.
//
// Get available stations.
//
// GET /station
GetStations(ctx context.Context) (*GetStationsOK, error)
// GetSubscriptions implements GetSubscriptions operation.
//
// Get current subscriptions.
//
// GET /subscription
GetSubscriptions(ctx context.Context) (*GetSubscriptionsOK, error)
// SubscribeSatellite implements SubscribeSatellite operation.
//
// Subscribe to a given station.
//
// POST /satellite/subscribe
SubscribeSatellite(ctx context.Context, req *SubscribeSatelliteReq) (*SubscribeSatelliteOK, error)
// SubscribeStation implements SubscribeStation operation.
//
// Subscribe to a given station.
//
// POST /station/subscribe
SubscribeStation(ctx context.Context, req *SubscribeStationReq) (*SubscribeStationOK, error)
// Unsubscribe implements Unsubscribe operation.
//
// Remove subscription by subscription ID.
//
// DELETE /subscription
Unsubscribe(ctx context.Context, params UnsubscribeParams) error
// NewError creates *ErrorStatusCode from error returned by handler.
//
// Used for common default response.
NewError(ctx context.Context, err error) *ErrorStatusCode
}
// 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
}