utils

package
v0.0.0-...-a7d350e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//# 对称加密key
	CryptoKey = "Adba723b7fe06819"
)

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(rawData string, key []byte) (string, error)

func Encrypt

func Encrypt(rawData, key []byte) (string, error)

func GenCid

func GenCid() string

对称加密IP和端口,当做clientId

func GenUUID

func GenUUID() string

GenUUID 生成uuid

func GetAddrByCid

func GetAddrByCid(cId string) (addr string)

获取client key地址信息

Types

type SyncMap

type SyncMap struct {
	sync.Map
}

func SyncMapIns

func SyncMapIns() *SyncMap

func (*SyncMap) C

func (s *SyncMap) C(k, v interface{})

func (*SyncMap) Clear

func (s *SyncMap) Clear()

清空

func (*SyncMap) D

func (s *SyncMap) D(k interface{})

func (*SyncMap) Each

func (s *SyncMap) Each(fu func(k, v interface{}) bool)

遍历

func (*SyncMap) R

func (s *SyncMap) R(k interface{}) (interface{}, bool)

func (*SyncMap) Size

func (s *SyncMap) Size() int64

大小

func (*SyncMap) U

func (s *SyncMap) U(k, v interface{}) (interface{}, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL