-
Notifications
You must be signed in to change notification settings - Fork 4
/
oas_server_gen.go
46 lines (41 loc) · 1.04 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 sentryapi
import (
"context"
)
// Handler handles operations described by OpenAPI v3 specification.
type Handler interface {
// Dummy implements dummy operation.
//
// Dummy endpoint to generate schema definitions.
//
// GET /dummy
Dummy(ctx context.Context) (*Event, error)
// Envelope implements envelope operation.
//
// Sentry push.
//
// POST /envelope
Envelope(ctx context.Context, req *EnvelopeReqWithContentType) 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
}