summaryrefslogtreecommitdiff
path: root/internal/models
diff options
context:
space:
mode:
Diffstat (limited to 'internal/models')
-rw-r--r--internal/models/ruleset.go22
-rw-r--r--internal/models/server.go29
2 files changed, 51 insertions, 0 deletions
diff --git a/internal/models/ruleset.go b/internal/models/ruleset.go
new file mode 100644
index 0000000..0764fc8
--- /dev/null
+++ b/internal/models/ruleset.go
@@ -0,0 +1,22 @@
+package models
+
+type RuleSet struct {
+ Tag string `json:"tag"`
+ Description string `json:"description"`
+ URL string `json:"url"`
+ Format string `json:"format"` // binary, source
+ Type string `json:"type"` // domain, ip
+ Optional bool `json:"optional"`
+ SHA256 string `json:"sha256,omitempty"`
+}
+
+type RuleSetManifest struct {
+ RuleSets []RuleSet `json:"rule_sets"`
+}
+
+type VersionResponse struct {
+ Version string `json:"version"`
+ URL string `json:"url"`
+ SHA256 string `json:"sha256,omitempty"`
+ Changelog string `json:"changelog,omitempty"`
+}
diff --git a/internal/models/server.go b/internal/models/server.go
new file mode 100644
index 0000000..2ca2701
--- /dev/null
+++ b/internal/models/server.go
@@ -0,0 +1,29 @@
+package models
+
+type TLS struct {
+ Enabled bool `json:"enabled"`
+ ServerName string `json:"server_name,omitempty"`
+}
+
+type Transport struct {
+ Type string `json:"type,omitempty"`
+ Path string `json:"path,omitempty"`
+}
+
+type Server struct {
+ Tag string `json:"tag"`
+ Region string `json:"region"`
+ Type string `json:"type"` // socks, vless, shadowsocks
+ Server string `json:"server"`
+ ServerPort int `json:"server_port"`
+ UDPOverTCP bool `json:"udp_over_tcp,omitempty"`
+ UUID string `json:"uuid,omitempty"`
+ Method string `json:"method,omitempty"`
+ Password string `json:"password,omitempty"`
+ TLS *TLS `json:"tls,omitempty"`
+ Transport *Transport `json:"transport,omitempty"`
+}
+
+type ServersResponse struct {
+ Servers []Server `json:"servers"`
+}