This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
/
transport_option.go
79 lines (67 loc) · 1.72 KB
/
transport_option.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
72
73
74
75
76
77
78
79
package model
import (
"go/ast"
stdtypes "go/types"
"github.com/swipe-io/swipe/pkg/openapi"
)
type ReqRespFunc struct {
Type stdtypes.Type
Expr ast.Expr
}
type ClientHTTPTransportOption struct {
Enable bool
}
type OpenapiMethodOption struct {
Tags []string
}
type OpenapiHTTPTransportOption struct {
Enable bool
Output string
Servers []openapi.Server
Info openapi.Info
Methods map[string]*OpenapiMethodOption
DefaultMethod OpenapiMethodOption
}
type WrapResponseHTTPTransportOption struct {
Enable bool
Name string
}
type JsonRPCHTTPTransportOption struct {
Enable bool
Path string
}
type MethodHTTPTransportOption struct {
MethodName string
Expr ast.Expr
Path string
PathVars map[string]string
HeaderVars map[string]string
QueryVars map[string]string
WrapResponse WrapResponseHTTPTransportOption
ServerRequestFunc ReqRespFunc
ServerResponseFunc ReqRespFunc
ClientRequestFunc ReqRespFunc
ClientResponseFunc ReqRespFunc
}
type ErrorHTTPTransportOption struct {
Named *stdtypes.Named
Code int64
IsPointer bool
}
type MarkdownDocHTTPTransportOption struct {
Enable bool
OutputDir string
}
type TransportOption struct {
Protocol string
Prefix string
ServerDisabled bool
Client ClientHTTPTransportOption
Openapi OpenapiHTTPTransportOption
MarkdownDoc MarkdownDocHTTPTransportOption
FastHTTP bool
JsonRPC JsonRPCHTTPTransportOption
MethodOptions map[string]MethodHTTPTransportOption
DefaultMethodOptions MethodHTTPTransportOption
Errors map[uint32]*ErrorHTTPTransportOption
}