summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/monaco-io/request/url.go
diff options
context:
space:
mode:
authorGary Kim <gary@garykim.dev>2020-07-18 22:08:25 +0800
committerGitHub <noreply@github.com>2020-07-18 16:08:25 +0200
commit71a5b72aff5159f3066ff100e1510d935ebdff85 (patch)
treef940bc6e7aa86e1ca818929fb4c2917983a32177 /vendor/github.com/monaco-io/request/url.go
parent213bf349c319811c8cb5458ac24ad9e61c5bbe4d (diff)
downloadmatterbridge-msglm-71a5b72aff5159f3066ff100e1510d935ebdff85.tar.gz
matterbridge-msglm-71a5b72aff5159f3066ff100e1510d935ebdff85.tar.bz2
matterbridge-msglm-71a5b72aff5159f3066ff100e1510d935ebdff85.zip
Add Nextcloud Talk support (#1167)
Signed-off-by: Gary Kim <gary@garykim.dev>
Diffstat (limited to 'vendor/github.com/monaco-io/request/url.go')
-rw-r--r--vendor/github.com/monaco-io/request/url.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/vendor/github.com/monaco-io/request/url.go b/vendor/github.com/monaco-io/request/url.go
new file mode 100644
index 00000000..98526149
--- /dev/null
+++ b/vendor/github.com/monaco-io/request/url.go
@@ -0,0 +1,36 @@
+package request
+
+import "net/url"
+
+type requestURL struct {
+ httpURL *url.URL
+ urlString string
+ parameters map[string]string
+}
+
+// EncodeURL add and encoded parameters.
+func (ru *requestURL) EncodeURL() (err error) {
+ ru.httpURL, err = url.Parse(ru.urlString)
+ if err != nil {
+ return err
+ }
+ query := ru.httpURL.Query()
+ for k := range ru.parameters {
+ query.Set(k, ru.parameters[k])
+ }
+ ru.httpURL.RawQuery = query.Encode()
+ return err
+}
+
+// String return example: https://www.google.com/search?a=1&b=2
+func (ru requestURL) string() string {
+ return ru.httpURL.String()
+}
+
+func (ru requestURL) scheme() string {
+ return ru.httpURL.Scheme
+}
+
+func (ru requestURL) host() string {
+ return ru.httpURL.Host
+}