-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgen.sh
executable file
·32 lines (21 loc) · 1.97 KB
/
gen.sh
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
#!/bin/bash
set -e
mkdir -p swagger
go-swagger generate client -f https://raw.githubusercontent.com/wkgcass/vproxy/dev/doc/api.yaml --api-package=vproxy.client.api --model-package=vproxy.client.model --client-package=vproxy.client --target=./swagger
# need to modify some generated code
sed -i -e 's/AllowNonBackend bool `json:"allowNonBackend,omitempty"`/AllowNonBackend *bool `json:"allowNonBackend,omitempty"`/g' "swagger/vproxy_client_model/socks5_server_create.go"
rm -f swagger/vproxy_client_model/socks5_server_create.go-e
sed -i -e 's/AllowNonBackend bool `json:"allowNonBackend,omitempty"`/AllowNonBackend *bool `json:"allowNonBackend,omitempty"`/g' "swagger/vproxy_client_model/socks5_server_update.go"
rm -f swagger/vproxy_client_model/socks5_server_update.go-e
sed -i -e 's/Weight int64 `json:"weight,omitempty"`/Weight *int64 `json:"weight,omitempty"`/g' "swagger/vproxy_client_model/server_update.go"
rm -f swagger/vproxy_client_model/server_update.go-e
sed -i -e 's/Weight int64 `json:"weight,omitempty"`/Weight *int64 `json:"weight,omitempty"`/g' "swagger/vproxy_client_model/server_create.go"
rm -f swagger/vproxy_client_model/server_create.go-e
sed -i -e 's/Weight int64 `json:"weight,omitempty"`/Weight *int64 `json:"weight,omitempty"`/g' "swagger/vproxy_client_model/server_group_in_upstream_create.go"
rm -f swagger/vproxy_client_model/server_group_in_upstream_create.go-e
sed -i -e 's/Weight int64 `json:"weight,omitempty"`/Weight *int64 `json:"weight,omitempty"`/g' "swagger/vproxy_client_model/server_group_in_upstream_update.go"
rm -f swagger/vproxy_client_model/server_group_in_upstream_update.go-e
sed -i -e 's/TTL int64 `json:"ttl,omitempty"`/TTL *int64 `json:"ttl,omitempty"`/g' "swagger/vproxy_client_model/dns_server_create.go"
rm -f swagger/vproxy_client_model/dns_server_create.go-e
sed -i -e 's/TTL int64 `json:"ttl,omitempty"`/TTL *int64 `json:"ttl,omitempty"`/g' "swagger/vproxy_client_model/dns_server_update.go"
rm -f swagger/vproxy_client_model/dns_server_update.go-e