Clean up Tunnel struct a bit

Removed unused CssId and moved members that should eventually be
removed from the API surface (ie internal values) to be together
so they're easier to identify later.
This commit is contained in:
Anders Pitman
2021-12-21 13:57:56 -07:00
parent b795ee0bc9
commit 0934799ccd
2 changed files with 8 additions and 8 deletions

View File

@@ -41,7 +41,6 @@ type DNSRecord struct {
}
type Tunnel struct {
Owner string `json:"owner"`
Domain string `json:"domain"`
ServerAddress string `json:"server_address"`
ServerPort int `json:"server_port"`
@@ -49,14 +48,17 @@ type Tunnel struct {
Username string `json:"username"`
TunnelPort int `json:"tunnel_port"`
TunnelPrivateKey string `json:"tunnel_private_key"`
ClientName string `json:"client_name"`
ClientAddress string `json:"client_address"`
ClientPort int `json:"client_port"`
AllowExternalTcp bool `json:"allow_external_tcp"`
AuthUsername string `json:"auth_username"`
AuthPassword string `json:"auth_password"`
CssId string `json:"css_id"`
TlsTermination string `json:"tls_termination"`
// TODO: These are not used by clients and shouldn't be returned in
// API calls.
Owner string `json:"owner"`
ClientName string `json:"client_name"`
AuthUsername string `json:"auth_username"`
AuthPassword string `json:"auth_password"`
TlsTermination string `json:"tls_termination"`
}
func NewDatabase() (*Database, error) {

View File

@@ -96,8 +96,6 @@ func (h *WebUiHandler) handleWebUiRequest(w http.ResponseWriter, r *http.Request
tunnels := h.api.GetTunnels(tokenData)
for domain, tun := range tunnels {
// TODO: might yield non-unique names
tun.CssId = strings.ReplaceAll(domain, ".", "-")
tunnels[domain] = tun
}