~bigbes/shroud

ref: 321879085cefec9f799abe941b2b76b17ad4a1db shroud/internal/api/models.go -rw-r--r-- 2.0 KiB
32187908 — Eugene Blikh refactor: rename Go module to go.bigb.es/shroud a month ago
                                                                                
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
package api

type AccessKeyResponse struct {
	ID        string         `json:"id"`
	Name      string         `json:"name"`
	Password  string         `json:"password"`
	Port      int            `json:"port"`
	Method    string         `json:"method"`
	AccessURL string         `json:"accessUrl"`
	DataLimit *DataLimitJSON `json:"dataLimit,omitempty"`
	AWG       *AWGKeyResponse   `json:"awg,omitempty"`
	VLESS     *VLESSKeyResponse `json:"vless,omitempty"`
}

type VLESSKeyResponse struct {
	UUID string `json:"uuid"`
}

type AWGKeyResponse struct {
	PublicKey string `json:"publicKey"`
	AllowedIP string `json:"allowedIP"`
	Endpoint  string `json:"endpoint"`
}

type DataLimitJSON struct {
	Bytes int64 `json:"bytes"`
}

type ServerResponse struct {
	Name                string         `json:"name"`
	ServerID            string         `json:"serverId"`
	MetricsEnabled      bool           `json:"metricsEnabled"`
	CreatedTimestampMs  int64          `json:"createdTimestampMs"`
	Version             string         `json:"version"`
	HostnameForAccessKeys string       `json:"hostnameForAccessKeys"`
	PortForNewAccessKeys  int          `json:"portForNewAccessKeys"`
	AccessKeyDataLimit    *DataLimitJSON `json:"accessKeyDataLimit,omitempty"`
}

type CreateAccessKeyRequest struct {
	ID        string         `json:"id,omitempty"`
	Name      string         `json:"name,omitempty"`
	Method    string         `json:"method,omitempty"`
	Password  string         `json:"password,omitempty"`
	Port      int            `json:"port,omitempty"`
	DataLimit *DataLimitJSON `json:"limit,omitempty"`
}

type SetDataLimitRequest struct {
	Limit DataLimitJSON `json:"limit"`
}

type SetPortRequest struct {
	Port int `json:"port"`
}

type SetHostnameRequest struct {
	Hostname string `json:"hostname"`
}

type SetNameRequest struct {
	Name string `json:"name"`
}

type MetricsEnabledResponse struct {
	MetricsEnabled bool `json:"metricsEnabled"`
}

type TransferMetricsResponse struct {
	BytesTransferredByUserId map[string]int64 `json:"bytesTransferredByUserId"`
}