This commit is contained in:
jinnrry committed 2023-08-12 12:49:57 +08:00
1 parent 4a26f52fde
commit 318fea24ad
42 files changed
+890 -375

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
package ssl
type authInfo struct {
Domain string
Token string
KeyAuth string
}
type HttpChallenge struct {
AuthInfo map[string]*authInfo
}
var instance *HttpChallenge
func (h *HttpChallenge) Present(domain, token, keyAuth string) error {
h.AuthInfo[token] = &authInfo{
Domain: domain,
Token: token,
KeyAuth: keyAuth,
}
return nil
}
func (h *HttpChallenge) CleanUp(domain, token, keyAuth string) error {
delete(h.AuthInfo, token)
return nil
}
func GetHttpChallengeInstance() *HttpChallenge {
if instance == nil {
instance = &HttpChallenge{
AuthInfo: map[string]*authInfo{},
}
}
return instance
}