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
/** | |
* 函数防抖包装函数 | |
* @author | |
* @export | |
* @class Debounced | |
*/ | |
export class Debounced { | |
/** | |
* @param func 需要包装的函数 | |
* @param delay 延迟时间,单位ms |
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
package main | |
import ( | |
"bufio" | |
"encoding/base64" | |
"flag" | |
"io" | |
"io/ioutil" | |
"log" | |
"net" |
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
// Please use the package https://github.com/chmike/domain as is it maintained up to date with tests. | |
// checkDomain returns an error if the domain name is not valid. | |
// See https://tools.ietf.org/html/rfc1034#section-3.5 and | |
// https://tools.ietf.org/html/rfc1123#section-2. | |
func checkDomain(name string) error { | |
switch { | |
case len(name) == 0: | |
return nil // an empty domain name will result in a cookie without a domain restriction | |
case len(name) > 255: |