Documentation ¶
Index ¶
- func CacheHttpBodyAdd(obj string, key string, value []byte) (err error)
- func CacheHttpBodyGet(obj string, key string) (err error, value interface{})
- func CacheHttpHeadAdd(obj string, key string, head *http.Header) (err error)
- func CacheHttpHeadGet(obj string, key string) (err error, head http.Header, n int64)
- func CacheHttpObjExist(obj string) bool
- func CacheTcpAdd(obj string, key string, value []byte) (err error)
- func CacheTcpGet(obj string, key string) (err error, value interface{})
- func CacheTcpObjExist(obj string) bool
- func CreateToken(id uint64, second int64, data []byte, secret, name string) string
- func Decrypt(ciphertext []byte, privatekey *rsa.PrivateKey) (decryptedtext []byte, err error)
- func DecryptByBytes(ciphertext, privatekey []byte) (decryptedtext []byte, err error)
- func DecryptPkcs(ciphertext []byte, privatekey *rsa.PrivateKey) (decryptedtext []byte, err error)
- func DecryptPkcsByBytes(ciphertext, privatekey []byte) (decryptedtext []byte, err error)
- func DumpPrivateKeyBytes(privatekey *rsa.PrivateKey) (err error, b []byte)
- func DumpPrivateKeyFile(privatekey *rsa.PrivateKey, filename string) error
- func DumpPublicKeyBytes(publickey *rsa.PublicKey) (err error, b []byte)
- func DumpPublicKeyFile(publickey *rsa.PublicKey, filename string) error
- func Encrypt(plaintext []byte, publickey *rsa.PublicKey) (ciphertext []byte, err error)
- func EncryptPkcs(plaintext []byte, publickey *rsa.PublicKey) (ciphertext []byte, err error)
- func GenerateKey(bit int) (*rsa.PrivateKey, error)
- func HttpConnLimitAdd(obj string, count int64) (err error)
- func InitCache(obj, cacheExpirationCleanTime string, defaultExpiration time.Duration, ...)
- func InitQueue()
- func LoadPrivateKeyBase64(base64key string) (*rsa.PrivateKey, error)
- func LoadPrivateKeyBytes(b []byte) (*rsa.PrivateKey, error)
- func LoadPrivateKeyFile(keyfile string) (*rsa.PrivateKey, error)
- func LoadPublicKeyBase64(base64key string) (*rsa.PublicKey, error)
- func LoadPublicKeyBytes(b []byte) (*rsa.PublicKey, error)
- func LoadPublicKeyFile(keyfile string) (*rsa.PublicKey, error)
- func QueueAddHandle(cmd uint32, handlerQueue HandlerQueueFunc)
- func QueueSend(subj string, b []byte, version, cmd uint32) (err error)
- func RateAdd(obj string, n, conn int64) (err error)
- func RateHttpAdd(obj string, rsp *http.Response, n int64) (err error)
- func RateLimitInit(obj string, maxRate, maxRatePer, maxConn, per int64) (err error)
- func TcpConnLimitAdd(obj string, count int64) (err error)
- func ToMd5(uid uint64, expireToken int64, secret string) (decode []byte)
- type Claims
- type HandlerQueueFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheHttpBodyGet ¶
func CacheHttpHeadAdd ¶
func CacheHttpHeadGet ¶
func CacheHttpObjExist ¶
func CacheTcpGet ¶
func CacheTcpObjExist ¶
func CreateToken ¶
func Decrypt ¶
func Decrypt(ciphertext []byte, privatekey *rsa.PrivateKey) (decryptedtext []byte, err error)
decrypt
func DecryptByBytes ¶
func DecryptPkcs ¶
func DecryptPkcs(ciphertext []byte, privatekey *rsa.PrivateKey) (decryptedtext []byte, err error)
decrypt
func DecryptPkcsByBytes ¶
func DumpPrivateKeyBytes ¶
func DumpPrivateKeyBytes(privatekey *rsa.PrivateKey) (err error, b []byte)
func DumpPrivateKeyFile ¶
func DumpPrivateKeyFile(privatekey *rsa.PrivateKey, filename string) error
func EncryptPkcs ¶
encrypt
func GenerateKey ¶
func GenerateKey(bit int) (*rsa.PrivateKey, error)
func HttpConnLimitAdd ¶
func LoadPrivateKeyBase64 ¶
func LoadPrivateKeyBase64(base64key string) (*rsa.PrivateKey, error)
Load private key from base64
func LoadPrivateKeyBytes ¶
func LoadPrivateKeyBytes(b []byte) (*rsa.PrivateKey, error)
func LoadPrivateKeyFile ¶
func LoadPrivateKeyFile(keyfile string) (*rsa.PrivateKey, error)
Load private key from private key file
func QueueAddHandle ¶
func QueueAddHandle(cmd uint32, handlerQueue HandlerQueueFunc)
func RateLimitInit ¶
func TcpConnLimitAdd ¶
Types ¶
type Claims ¶
type Claims struct { Uid uint64 `json:"uid,omitempty"` Name string `json:"name,omitempty"` Data *json.RawMessage `json:"data,omitempty"` jwt.StandardClaims }
type HandlerQueueFunc ¶
type HandlerQueueFunc func(b []byte)
Click to show internal directories.
Click to hide internal directories.