Documentation ¶
Index ¶
- Constants
- Variables
- func AesDecrypt(str string) (string, error)
- func AesEncrypt(str string) (string, error)
- func Base64(value []byte) string
- func CacheDeleteValue(key string) bool
- func CacheReadValue(key string) string
- func CacheWriteValue(key, value string, timeout int) error
- func CatchPanic()
- func CatchPanicThenRun(catchFun func())
- func Compression(data string) ([]byte, error)
- func DecodeString(s string) ([]byte, error)
- func Decompression(data string) (string, error)
- func EncodingString(s []byte) string
- func FormatCacheKey(strs ...string) string
- func GenerateRsaKey(bits int) (string, string)
- func Get(url string) (string, error)
- func GetDB() *gorm.DB
- func GetLocalOutboundAddress() net.IP
- func GetMacAddress(ip string) string
- func GetRandomUint32() (r uint32)
- func HMACSha256(key, value string) []byte
- func HashFile(method string, fileName string) (string, error)
- func MD5(value string) string
- func MarshalToString(v any) string
- func NewGorm(host, u, p, db string, isencrypt bool) error
- func NewUUID() (string, error)
- func ParseBool(v int) bool
- func ParseInt(v string) int
- func ParseInt64ToInt(v int64) int
- func ParseUInt64(v string) uint64
- func RandNumber() int
- func ReadWholeFile(fileName string) (string, error)
- func Request(url, method string, str string, header map[string]string) (string, error)
- func Run(command string, in string, args ...string) (string, string, error)
- func Unmarshal(v []byte, o any) error
- func WatchFile(file string, callback func()) io.Closer
- type IPSet
- type IPTYPE
- type IPTables
- type WaitPool
Constants ¶
View Source
const ( CACHESIZE = 1 * 1024 * 1024 // Note value size larger than 1/1024 of total cache size will not be cached EXPIRE_GRPC_DNS = 60 * 60 * 2 EXPIRE_GRPC_SMARTSENCE = 60 * 60 * 2 EXPIRE_LINKER_LEASE = 60 * 5 EXPIRE_LOG_TIMEGAP = 5 // 日志打印时间间隔,单位秒 EXPIRE_LINKER_PEER = 60 EXPIRE_PEER_POLICY_IP = 10 EXPIRE_USER_FORBIDDEN_IP = 10 EXPIRE = 0 )
View Source
const ( DefaultSet = "defaultset" DefaultSetV6 = "defaultset_v6" WhitelistSet = "whitelistset" WhitelistSetV6 = "whitelistset_v6" BlacklistSet = "blacklistset" BlacklistSetV6 = "blacklistset_v6" TempSet = "tempset" TempSetV6 = "tempset_v6" )
View Source
const ( POLICY_ACCEPT = iota POLICY_DROP POLICY_REJECT )
View Source
const (
APITOKEN = "x&Clouddeep@BJ2023#!@#."
)
View Source
const ( // ContentType ContentType ContentType string = "application/x-www-form-urlencoded" )
Variables ¶
View Source
var ( Marshal = json.Marshal UnmarshalX = json.Unmarshal MarshalIndent = json.MarshalIndent MarshalToStringX = json.MarshalToString NewDecoder = json.NewDecoder NewEncoder = json.NewEncoder )
定义JSON操作
Functions ¶
func AesEncrypt ¶
func CacheDeleteValue ¶
func CacheReadValue ¶
func CacheWriteValue ¶
func CatchPanic ¶
func CatchPanic()
func CatchPanicThenRun ¶
func CatchPanicThenRun(catchFun func())
func Compression ¶
func DecodeString ¶
func Decompression ¶
func EncodingString ¶
func FormatCacheKey ¶
func GenerateRsaKey ¶
func GetLocalOutboundAddress ¶
func GetMacAddress ¶
func GetRandomUint32 ¶
func GetRandomUint32() (r uint32)
func HMACSha256 ¶
func ParseInt64ToInt ¶
func ParseUInt64 ¶
func RandNumber ¶
func RandNumber() int
func ReadWholeFile ¶
Types ¶
type IPSet ¶
Click to show internal directories.
Click to hide internal directories.