/
oas_server_gen.go
46 lines (41 loc) · 1.02 KB
/
oas_server_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Code generated by ogen, DO NOT EDIT.
package otelbotapi
import (
"context"
)
// Handler handles operations described by OpenAPI v3 specification.
type Handler interface {
// GetStatus implements getStatus operation.
//
// Get status.
//
// GET /status
GetStatus(ctx context.Context) (*GetStatusOK, error)
// Ping implements ping operation.
//
// GET /ping
Ping(ctx context.Context) 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
sec SecurityHandler
baseServer
}
// NewServer creates new Server.
func NewServer(h Handler, sec SecurityHandler, opts ...ServerOption) (*Server, error) {
s, err := newServerConfig(opts...).baseServer()
if err != nil {
return nil, err
}
return &Server{
h: h,
sec: sec,
baseServer: s,
}, nil
}