-
Notifications
You must be signed in to change notification settings - Fork 155
Expand file tree
/
Copy pathinvoke_model.go
More file actions
79 lines (63 loc) · 2.33 KB
/
Copy pathinvoke_model.go
File metadata and controls
79 lines (63 loc) · 2.33 KB
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
// libXray is an Xray wrapper focusing on improving the experience of Xray-core mobile development.
package libXray
import "encoding/json"
type LibXrayMethod string
const (
LibXrayMethodGetFreePorts LibXrayMethod = "getFreePorts"
LibXrayMethodConvertShareLinksToXrayJson LibXrayMethod = "convertShareLinksToXrayJson"
LibXrayMethodConvertXrayJsonToShareLinks LibXrayMethod = "convertXrayJsonToShareLinks"
LibXrayMethodCountGeoData LibXrayMethod = "countGeoData"
LibXrayMethodPing LibXrayMethod = "ping"
LibXrayMethodTestXray LibXrayMethod = "testXray"
LibXrayMethodRunXray LibXrayMethod = "runXray"
LibXrayMethodRunXrayFromJson LibXrayMethod = "runXrayFromJson"
LibXrayMethodStopXray LibXrayMethod = "stopXray"
LibXrayMethodXrayVersion LibXrayMethod = "xrayVersion"
LibXrayMethodGetXrayState LibXrayMethod = "getXrayState"
)
type LibXrayInvokeRequest struct {
APIVersion int `json:"apiVersion,omitempty"`
Method LibXrayMethod `json:"method,omitempty"`
Payload json.RawMessage `json:"payload,omitempty"`
}
type GetFreePortsRequest struct {
Count int `json:"count,omitempty"`
}
type GetFreePortsResponse struct {
Ports []int `json:"ports,omitempty"`
}
type ConvertShareLinksToXrayJsonRequest struct {
Text string `json:"text,omitempty"`
}
type ConvertXrayJsonToShareLinksRequest struct {
XrayJson string `json:"xrayJson,omitempty"`
}
type ConvertXrayJsonToShareLinksResponse struct {
Links string `json:"links,omitempty"`
}
type CountGeoDataRequest struct {
Name string `json:"name,omitempty"`
GeoType string `json:"geoType,omitempty"`
DatDir string `json:"datDir,omitempty"`
}
type PingRequest struct {
ConfigPath string `json:"configPath,omitempty"`
Timeout int `json:"timeout,omitempty"`
URL string `json:"url,omitempty"`
Proxy string `json:"proxy,omitempty"`
}
type PingResponse struct {
Delay int64 `json:"delay,omitempty"`
}
type RunXrayRequest struct {
ConfigPath string `json:"configPath,omitempty"`
}
type RunXrayFromJSONRequest struct {
ConfigJSON string `json:"configJSON,omitempty"`
}
type XrayVersionResponse struct {
Version string `json:"version,omitempty"`
}
type GetXrayStateResponse struct {
Running bool `json:"running"`
}