mirror of
https://github.com/derfenix/webarchive.git
synced 2026-03-11 22:40:58 +03:00
Initial commit
This commit is contained in:
52
api/openapi/oas_server_gen.go
Normal file
52
api/openapi/oas_server_gen.go
Normal file
@@ -0,0 +1,52 @@
|
||||
// Code generated by ogen, DO NOT EDIT.
|
||||
|
||||
package openapi
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
// Handler handles operations described by OpenAPI v3 specification.
|
||||
type Handler interface {
|
||||
// AddPage implements addPage operation.
|
||||
//
|
||||
// Add new page.
|
||||
//
|
||||
// POST /pages
|
||||
AddPage(ctx context.Context, req OptAddPageReq) (*Page, error)
|
||||
// GetPage implements getPage operation.
|
||||
//
|
||||
// Get page details.
|
||||
//
|
||||
// GET /pages/{id}
|
||||
GetPage(ctx context.Context, params GetPageParams) (GetPageRes, error)
|
||||
// GetPages implements getPages operation.
|
||||
//
|
||||
// Get all pages.
|
||||
//
|
||||
// GET /pages
|
||||
GetPages(ctx context.Context) (Pages, 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
|
||||
}
|
||||
Reference in New Issue
Block a user