TUN-3998: Allow to cleanup the connections of a tunnel limited to a single client

This commit is contained in:
Nuno Diegues
2021-03-19 23:26:51 +00:00
parent 9767ba1853
commit 4a7763e497
5 changed files with 52 additions and 7 deletions

View File

@@ -0,0 +1,25 @@
package tunnelstore
import (
"net/url"
"github.com/google/uuid"
)
type CleanupParams struct {
queryParams url.Values
}
func NewCleanupParams() *CleanupParams {
return &CleanupParams{
queryParams: url.Values{},
}
}
func (cp *CleanupParams) ForClient(clientID uuid.UUID) {
cp.queryParams.Set("client_id", clientID.String())
}
func (cp CleanupParams) encode() string {
return cp.queryParams.Encode()
}