Categorygithub.com/qtgolang/qt
modulepackage
0.0.0-20220113155034-2bee288a42b5
Repository: https://github.com/qtgolang/qt.git
Documentation: pkg.go.dev

# README

qt

  • 封装有以下功能

JSON

HTTP

mysql

常用随机功能

常用字符串操作

Gzip

Zlib

Socket Server

Socket Client

RSA 算法

AES 算法

DES 算法

Hash加密

常用文件操作

  • JSON 示例

package main

import (
   "fmt"
   "github.com/qtgolang/qt"
)

func main() {
   j:=qt.JSON()
   j.Untie(`{"a":1,"b":true}`)
   fmt.Println(j.GetFloat64("a"))
   fmt.Println(j.GetBool("b"))
   }
  • Aes 示例 /Des 类似

package main

import (
   "fmt"
   "github.com/qtgolang/qt"
)

func main() {
   a := qt.Aes()
   a.SetPadding(qt.Type_Const_Padding_Pkcs5)
   a.SetEncMethod(qt.Type_Const_AES_DES_ECB)
   a.SetFill(true)
   a.SetKey("01234567890123456")
   fmt.Println(hex.EncodeToString(a.Encrypt([]byte("000000000"))))
   }
  • Http 示例

package main

import (
   "fmt"
   "github.com/qtgolang/qt"
)

func main() {
   h := qt.Http()
   h.Open("GET", "https://www.baidu.com")
   h.Send("")
   fmt.Println(h.GetBodyAuto())
   }

# Functions

Aes 返回一个AES类型.
Des 返回一个DES类型.
File .
Gzip 返回一个Gzip类型 可以用于 压缩和解压缩.
Hash 常用Hash 算法 参数1 请使用 [Type.Hash_]选择.
Hmac 常用Hash-Hmac 算法 参数1 请使用 [Type_Const_Hash_]选择.
Winhttp 返回一个Winhttp类型 实现GET POST 等请求.
Json 返回一个Json类型 支持以下类型 动态添加 【map对象/任意类型合集/数组对象/浮点数/整数/逻辑/字符串】 包括在数组内指定位置添加,能自动扩容 动态删除 【map对象/任意类型合集/数组对象/浮点数/整数/逻辑/字符串】 包括在数组内指定位置删除 动态取值 【map对象/任意类型合集/数组对象/浮点数/整数/逻辑/字符串】.
*====================================================== */.
No description provided by the author
Mysql 返回一个Mysql类型.
获取一个AES实例对象.
获取一个des实例对象.
No description provided by the author
Rand .
RSA .
*====================================================== */.
*====================================================== */.
*====================================================== */.
*====================================================== */.
*====================================================== */.
*====================================================== */.
No description provided by the author
SocketClient .
SocketServer .
String 返回一个Qtstring类型.
Zlib .

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Hash_End Hash结束处的标志.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Hash_Stat Hash开始处的标志.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Client .
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Server .