MCPcopy Create free account
hub / github.com/Hidden-Node/GooseRelayVPN-AndroidClient / normalizeDeploymentID

Function normalizeDeploymentID

internal/config/client.go:129–149  ·  view source on GitHub ↗
(v string)

Source from the content-addressed store, hash-verified

127}
128
129func normalizeDeploymentID(v string) string {
130 v = strings.TrimSpace(v)
131 if v == "" {
132 return ""
133 }
134 // Accept plain deployment key and tolerate pasting the full /exec URL.
135 v = strings.TrimSuffix(v, "/exec")
136 v = strings.Trim(v, "/")
137 parts := strings.Split(v, "/")
138 if len(parts) >= 2 {
139 for i := 0; i < len(parts)-1; i++ {
140 if parts[i] == "s" {
141 return parts[i+1]
142 }
143 }
144 }
145 if len(parts) > 0 {
146 return parts[len(parts)-1]
147 }
148 return v
149}
150
151func buildScriptURL(deploymentID string) string {
152 return fmt.Sprintf("https://script.google.com/macros/s/%s/exec", deploymentID)

Callers 1

LoadClientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected