-
Notifications
You must be signed in to change notification settings - Fork 4
/
oas_server_gen.go
71 lines (66 loc) · 2.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Code generated by ogen, DO NOT EDIT.
package tempoapi
import (
"context"
)
// Handler handles operations described by OpenAPI v3 specification.
type Handler interface {
// Echo implements echo operation.
//
// Echo request for testing, issued by Grafana.
//
// GET /api/echo
Echo(ctx context.Context) (EchoOK, error)
// Search implements search operation.
//
// Execute TraceQL query.
//
// GET /api/search
Search(ctx context.Context, params SearchParams) (*Traces, error)
// SearchTagValues implements searchTagValues operation.
//
// This endpoint retrieves all discovered values for the given tag, which can be used in search.
//
// GET /api/search/tag/{tag_name}/values
SearchTagValues(ctx context.Context, params SearchTagValuesParams) (*TagValues, error)
// SearchTagValuesV2 implements searchTagValuesV2 operation.
//
// This endpoint retrieves all discovered values and their data types for the given TraceQL
// identifier.
//
// GET /api/v2/search/tag/{tag_name}/values
SearchTagValuesV2(ctx context.Context, params SearchTagValuesV2Params) (*TagValuesV2, error)
// SearchTags implements searchTags operation.
//
// This endpoint retrieves all discovered tag names that can be used in search.
//
// GET /api/search/tags
SearchTags(ctx context.Context) (*TagNames, error)
// TraceByID implements traceByID operation.
//
// Querying traces by id.
//
// GET /api/traces/{traceID}
TraceByID(ctx context.Context, params TraceByIDParams) (TraceByIDRes, 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
}