Documentation ¶
Overview ¶
* * Created by GoLand * User: dollarkiller * Date: 19-7-23 * Time: 下午3:44 *
* * Created by GoLand * User: dollarkiller * Date: 19-6-12 * Time: 上午11:53 *
*
- @Author: DollarKiller
- @Description: JSONP 比官方库更高效处理json
- @Github: https://github.com/dollarkillerx
- @Date: Create in 10:46 2019-10-01
* * Created by GoLand * User: dollarkiller * Date: 19-7-11 * Time: 上午11:08 *
* * Created by GoLand * User: dollarkiller * Date: 19-7-9 * Time: 下午6:10 *
* * Created by GoLand * User: dollarkiller * Date: 19-6-9 * Time: 下午12:08 * @Description: 自研 多兼容 session (设计思路一个中央控制器 一个interface实现控制器下的方法) * @Github: https://github.com/dollarkillerx *
* * Created by GoLand * User: dollarkiller * Date: 19-7-3 * Time: 下午8:47 *
Index ¶
- Variables
- func Base64Decode(s string) ([]byte, error)
- func Base64Encode(data []byte) string
- func Base64URLDecode(s string) ([]byte, error)
- func Base64URLEncode(data []byte) string
- func CaptchaCheck(captchaId, verifyValue string) (bool, error)
- func CaptchaMP3() (captchaId, base64MP3 string)
- func CaptchaMath() (captchaId, base64Png string)
- func CaptchaNum() (captchaId, base64Png string)
- func DirPing(path string) error
- func EasyJwtCheckUserLogin(email string) (token string, err error)
- func EasyJwtGeneraToken(data *EasyJwtPayload, hour int) (string, error)
- func EasyJwtVerification(jwt string) error
- func FielGetSize(filename string) int64
- func FileGetMD5(file *os.File) string
- func FileGetPostfix(filename string) (string, error)
- func FileGetRandomName(postfilx string) string
- func FileGetSha1(file *os.File) string
- func FileSaveRenameSimple(name string, data []byte, path string) (string, error)
- func FileSaveSimple(name string, data []byte, path string) error
- func GenRsaKey(bits int) (e error, priKey string, pubKey string)
- func GetFullChinaName() string
- func Md5Encode(str string) string
- func NewUUID() (string, error)
- func NewUUIDSimplicity() (string, error)
- func OffsetMath(page, limit int) int
- func PathExists(path string) (bool, error)
- func Prepend(sc *[]interface{}, value interface{}) *[]interface{}
- func Random(min, max int) int
- func ReptileGetSpiderAgent() string
- func ReptileGetUserAgent() string
- func RsaDecrypt(ciphertext, privateKey []byte) ([]byte, error)
- func RsaDecryptSimple(ciphertext, privateKey string) (string, error)
- func RsaEncrypt(origData, pubKey []byte) ([]byte, error)
- func RsaEncryptSimple(origData, pubKey string) (string, error)
- func RsaSign(data, prvKey []byte) ([]byte, error)
- func RsaSignSimple(data, prvKey string) (string, error)
- func RsaSignVer(data, signature, publicKey []byte) error
- func RsaSignVerSimple(data, signature, publicKey string) error
- func Sha1Encode(str string) string
- func Sha256Encode(str string) string
- func SliceDel(sc *[]interface{}, index int) *[]interface{}
- func SuperRand() string
- func TimeGetNowTime() int
- func TimeGetNowTimeStr() string
- func TimeGetStringToTime(times string) (string, error)
- func TimeGetTimeToString(times string) (string, error)
- func TrimHtml(src string) string
- func UrlEncoding(urls string) (string, error)
- type EasyJwtPayload
- type GoSessionNode
- type JwtHeader
- type JwtPayload
- type JwtUtils
- type LayGet
- type LayUiPage
- type ProxySt
- func (p *ProxySt) CheckProxy() error
- func (p *ProxySt) ReptileDownloadAndSaveSimple(targerUrl string, cookies []*http.Cookie, name, path string) (string, error)
- func (p *ProxySt) ReptileDownloadSimple(targerUrl string, cookies []*http.Cookie) ([]byte, error)
- func (p *ProxySt) ReptileSpiderRequestFrom(targerUrl string, body io.Reader, cookies []*http.Cookie) (*http.Response, error)
- func (p *ProxySt) ReptileUserRequestFrom(targerUrl string, body io.Reader, cookies []*http.Cookie) (*http.Response, error)
- type Session
- type SessionInterface
Constants ¶
This section is empty.
Variables ¶
var ( LayEmptyData = &LayUiPage{Code: 0, Count: 0, Msg: "Empty Data"} // 空数据 LayErrorData = &LayUiPage{Code: -1, Count: 0, Msg: "Error Data"} // 异常数据 )
定义空数据 当无数据 或者数据异常时返回
var Jsonp = jsoniter.ConfigCompatibleWithStandardLibrary
Functions ¶
func CaptchaCheck ¶
@验证验证码是否正确 captchaId verifyValue 用户输入
func EasyJwtCheckUserLogin ¶
验证用户是否已经登录
func EasyJwtGeneraToken ¶
func EasyJwtGeneraToken(data *EasyJwtPayload, hour int) (string, error)
生成token 载荷
func FileSaveRenameSimple ¶
保存文件 并从命名 Simple 版本 return: NewName,error
func FileSaveSimple ¶
保存文件 return error
func RsaDecrypt ¶
Rsa256 解密 @params: ciphertext 加密数据 @Params: prvKey 私钥
func RsaDecryptSimple ¶
Rsa256 解密简单
func RsaEncrypt ¶
Rsa256 加密 @params: origData 原始数据 @Params: pubKey 公钥
func RsaEncryptSimple ¶
Rsa256 加密简单 @params: origData 原始数据 @Params: pubKey 公钥
func RsaSignSimple ¶
Rsa256 签名简单 @params: origData 需要签名的数据 @Params: prvKey 私钥
func RsaSignVer ¶
Rsa256 验签 @params: data 原始数据 @params: signature 签名 @params: publicKey 公钥
func RsaSignVerSimple ¶
Rsa256 验签简单 @params: data 原始数据 @params: signature 签名 @params: publicKey 公钥
Types ¶
type EasyJwtPayload ¶
type GoSessionNode ¶
type GoSessionNode struct { }
================================不同数据源的实现===================================== 系统自带 gocache 存储
func (*GoSessionNode) Del ¶
func (g *GoSessionNode) Del(id string) error
func (*GoSessionNode) Expired ¶
func (g *GoSessionNode) Expired(id string) bool
type JwtPayload ¶
type JwtUtils ¶
type JwtUtils struct {
// contains filtered or unexported fields
}
token
func (*JwtUtils) GeneraJwtToken ¶
func (t *JwtUtils) GeneraJwtToken(header *JwtHeader, payload *JwtPayload) (string, error)
生成JWT
func (*JwtUtils) GeneraJwtTokenToData ¶
func (t *JwtUtils) GeneraJwtTokenToData(header *JwtHeader, payload *JwtPayload) (string, error)
生成token并存入 内存中
func (*JwtUtils) VerificationTokenByData ¶
验证token从缓存中
type LayUiPage ¶
type LayUiPage struct { Code int `json:"code"` Count int `json:"count"` Data interface{} `json:"data"` Msg string `json:"msg"` }
分页返回数据结构体
type ProxySt ¶
type ProxySt struct { UserName string Password string ProxyServer string // contains filtered or unexported fields }
func (*ProxySt) ReptileDownloadAndSaveSimple ¶
func (p *ProxySt) ReptileDownloadAndSaveSimple(targerUrl string, cookies []*http.Cookie, name, path string) (string, error)
文件下载并保存 目标地址,cookies,文件名称,新路径
func (*ProxySt) ReptileDownloadSimple ¶
文件下载
type Session ¶
type Session struct { Name string Identification string // 唯一身份标识 Data map[string]interface{} // 存储器 CreationTime int64 // 创建时间 ExpirationTime int64 // 过期时间 }
session node
type SessionInterface ¶
type SessionInterface interface { Get(id string) (*Session, error) // 拥有通过id获取session Set(data *Session) (string, error) // 返回id and 错误信息 SetTime(data *Session, tim time.Duration) (string, error) // 返回id and 错误信息 Del(id string) error Expired(id string) bool // 检测是否过期 过期返回false 反之true }
func SessionGetByGoCache ¶
func SessionGetByGoCache() SessionInterface
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
* * @Author: DollarKiller * @Description: 压缩字符串 * @Github: https://github.com/dollarkillerx * @Date: Create in 20:38 2019-09-25 * * @Author: DollarKiller * @Description: * @Github: https://github.com/dollarkillerx * @Date: Create in 16:25 2019-09-21
|
* * @Author: DollarKiller * @Description: 压缩字符串 * @Github: https://github.com/dollarkillerx * @Date: Create in 20:38 2019-09-25 * * @Author: DollarKiller * @Description: * @Github: https://github.com/dollarkillerx * @Date: Create in 16:25 2019-09-21 |
* * @Author: DollarKiller * @Description: * @Github: https://github.com/dollarkillerx * @Date: Create in 16:27 2019-09-21
|
* * @Author: DollarKiller * @Description: * @Github: https://github.com/dollarkillerx * @Date: Create in 16:27 2019-09-21 |
* * @Author: DollarKiller * @Description: form 结构体绑定 * @Github: https://github.com/dollarkillerx * @Date: Create in 17:41 2019-09-14
|
* * @Author: DollarKiller * @Description: form 结构体绑定 * @Github: https://github.com/dollarkillerx * @Date: Create in 17:41 2019-09-14 |
* * @Author: DollarKiller * @Description: 添加方法 * @Github: https://github.com/dollarkillerx * @Date: Create in 11:26 2019-09-15
|
* * @Author: DollarKiller * @Description: 添加方法 * @Github: https://github.com/dollarkillerx * @Date: Create in 11:26 2019-09-15 |
* * @Author: DollarKiller * @Description: 邮件相关 * @Github: https://github.com/dollarkillerx * @Date: Create in 14:45 2019-09-12
|
* * @Author: DollarKiller * @Description: 邮件相关 * @Github: https://github.com/dollarkillerx * @Date: Create in 14:45 2019-09-12 |
* * @Author: DollarKiller * @Description: 尽最大可能获取用户ip * @Github: https://github.com/dollarkillerx * @Date: Create in 17:01 2019-09-18
|
* * @Author: DollarKiller * @Description: 尽最大可能获取用户ip * @Github: https://github.com/dollarkillerx * @Date: Create in 17:01 2019-09-18 |
test
|
|
Package uuid provides implementation of Universally Unique Identifier (UUID).
|
Package uuid provides implementation of Universally Unique Identifier (UUID). |