Repository navigation
Expand file tree
/
Copy pathinvoke_model.go
More file actions
131 lines (104 loc) · 3.69 KB
/
Copy pathinvoke_model.go
File metadata and controls
131 lines (104 loc) · 3.69 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// libXray is an Xray wrapper focusing on improving the experience of Xray-core mobile development.
package libXray
import (
"encoding/json"
)
type LibXrayMethod string
const LibXrayAPIVersion = 3
const (
LibXrayMethodGetWindowsVpnUplink LibXrayMethod = "getWindowsVpnUplink"
LibXrayMethodGetFreePorts LibXrayMethod = "getFreePorts"
LibXrayMethodDecodeSubscriptionText LibXrayMethod = "decodeSubscriptionText"
LibXrayMethodConvertShareLinksToXrayJson LibXrayMethod = "convertShareLinksToXrayJson"
LibXrayMethodConvertXrayJsonToShareLinks LibXrayMethod = "convertXrayJsonToShareLinks"
LibXrayMethodGenerateAgeKeyPair LibXrayMethod = "generateAgeKeyPair"
LibXrayMethodCountGeoData LibXrayMethod = "countGeoData"
LibXrayMethodPingBatch LibXrayMethod = "pingBatch"
LibXrayMethodTestXray LibXrayMethod = "testXray"
LibXrayMethodRunXray LibXrayMethod = "runXray"
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 GetWindowsVpnUplinkResponse struct {
Fingerprint string `json:"fingerprint"`
}
type GetFreePortsRequest struct {
Count int `json:"count,omitempty"`
ExcludePorts []int `json:"excludePorts,omitempty"`
}
type GetFreePortsResponse struct {
Ports []int `json:"ports,omitempty"`
}
type AgeDecryptConfig struct {
SecretKey string `json:"secretKey,omitempty"`
}
type DecodeSubscriptionTextRequest struct {
Text string `json:"text,omitempty"`
Age *AgeDecryptConfig `json:"age,omitempty"`
}
type DecodeSubscriptionTextResponse struct {
Text string `json:"text"`
}
type ConvertShareLinksToXrayJsonRequest struct {
Text string `json:"text,omitempty"`
Age *AgeDecryptConfig `json:"age,omitempty"`
}
type AgeKeyType string
const (
AgeKeyTypeX25519 AgeKeyType = "x25519"
AgeKeyTypeHybrid AgeKeyType = "hybrid"
)
type GenerateAgeKeyPairRequest struct {
KeyType AgeKeyType `json:"keyType,omitempty"`
}
type GenerateAgeKeyPairResponse struct {
SecretKey string `json:"secretKey,omitempty"`
PublicKey string `json:"publicKey,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 PingBatchRequest struct {
Configs []PingBatchItemRequest `json:"configs,omitempty"`
Timeout int `json:"timeout,omitempty"`
URL string `json:"url,omitempty"`
Warm bool `json:"warm,omitempty"`
}
type PingBatchItemRequest struct {
XrayJson string `json:"xrayJson,omitempty"`
OutboundTag string `json:"outboundTag,omitempty"`
}
type PingBatchResponse struct {
Results []PingBatchItemResponse `json:"results,omitempty"`
}
type PingBatchItemResponse struct {
Success bool `json:"success"`
Delay int64 `json:"delay"`
Error string `json:"error,omitempty"`
}
type RunXrayRequest struct {
XrayJson string `json:"xrayJson,omitempty"`
}
type TestXrayRequest struct {
XrayJson string `json:"xrayJson,omitempty"`
}
type XrayVersionResponse struct {
Version string `json:"version,omitempty"`
}
type GetXrayStateResponse struct {
Running bool `json:"running"`
}