-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support query forward and temp table (#143)
* support cookie * ci: TestTempTable() * feat: support query forward. * feat: support logout * test logout * fix * ci: use image datafuselabs/databend:nightly
- Loading branch information
1 parent
a06d3bc
commit 47ac2ed
Showing
7 changed files
with
106 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package godatabend | ||
|
||
import ( | ||
"net/http" | ||
"net/url" | ||
"sync" | ||
) | ||
|
||
type IgnoreDomainCookieJar struct { | ||
mu sync.Mutex | ||
cookies map[string]*http.Cookie | ||
} | ||
|
||
func NewIgnoreDomainCookieJar() *IgnoreDomainCookieJar { | ||
return &IgnoreDomainCookieJar{ | ||
cookies: make(map[string]*http.Cookie), | ||
} | ||
} | ||
|
||
func (jar *IgnoreDomainCookieJar) SetCookies(_u *url.URL, cookies []*http.Cookie) { | ||
jar.mu.Lock() | ||
defer jar.mu.Unlock() | ||
for _, cookie := range cookies { | ||
jar.cookies[cookie.Name] = cookie | ||
} | ||
} | ||
|
||
func (jar *IgnoreDomainCookieJar) Cookies(u *url.URL) []*http.Cookie { | ||
jar.mu.Lock() | ||
defer jar.mu.Unlock() | ||
result := make([]*http.Cookie, 0, len(jar.cookies)) | ||
for _, cookie := range jar.cookies { | ||
result = append(result, cookie) | ||
} | ||
return result | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters