diff options
| author | Mistivia <i@mistivia.com> | 2025-11-02 15:27:18 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-11-02 15:27:18 +0800 |
| commit | e9c24f4af7ed56760f6db7941827d09f6db9020b (patch) | |
| tree | 62128c43b883ce5e3148113350978755779bb5de /teleirc/matterbridge/vendor/github.com/monaco-io/request/model.go | |
| parent | 58d5e7cfda4781d8a57ec52aefd02983835c301a (diff) | |
add matterbridge
Diffstat (limited to 'teleirc/matterbridge/vendor/github.com/monaco-io/request/model.go')
| -rw-r--r-- | teleirc/matterbridge/vendor/github.com/monaco-io/request/model.go | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/teleirc/matterbridge/vendor/github.com/monaco-io/request/model.go b/teleirc/matterbridge/vendor/github.com/monaco-io/request/model.go new file mode 100644 index 0000000..2a3041e --- /dev/null +++ b/teleirc/matterbridge/vendor/github.com/monaco-io/request/model.go @@ -0,0 +1,63 @@ +package request + +import ( + "crypto/tls" + "net/http" + "time" +) + +// ContentType Content-Type +type ContentType string + +// Method http method +// TODO: +type Method string + +// Client Method +/* + Method = "OPTIONS" ; Section 9.2 + | "GET" ; Section 9.3 + | "HEAD" ; Section 9.4 + | "POST" ; Section 9.5 + | "PUT" ; Section 9.6 + | "DELETE" ; Section 9.7 + | "TRACE" ; Section 9.8 + | "CONNECT" ; Section 9.9 + | extension-method + extension-method = token + token = 1*<any CHAR except CTLs or separators> +*/ +type Client struct { + URL string + Method string + Header map[string]string + Params map[string]string + Body []byte + BasicAuth BasicAuth + Timeout time.Duration // second + ProxyURL string + ContentType ContentType + Cookies []*http.Cookie + TLSConfig *tls.Config + Transport *http.Transport + + // private + client *http.Client + requestURL requestURL + req *http.Request +} + +// BasicAuth Add Username:Password as Basic Auth +type BasicAuth struct { + Username string + Password string +} + +// SugaredResp Sugared response with status code and body data +type SugaredResp struct { + Data []byte + Code int + + // private + resp *http.Response +} |
