Documentation ¶
Index ¶
- func Base64Decode(str string) (string, error)
- func Base64Encode(str string) string
- func CRC32(data string) int64
- func Decomposition(data int) []int
- func FloatVal(data string) (float64, bool)
- func GBKToUTF8(data string) (string, error)
- func GCD(data ...int) int
- func GetMapVal(ac MapFunc) error
- func Guid() string
- func Has(key interface{}, val ...interface{}) bool
- func HashID(id string, m int64) int64
- func IntVal(data string) (int64, bool)
- func JSONMarshal(dstr interface{}) string
- func JSONToStr(dstr interface{}) string
- func MD5(s string) string
- func MapToStruct(data map[string]string, out interface{}) error
- func MsTime() int64
- func ObjectIDCounter(w int) string
- func RandID(width int) string
- func Sha1(s string) string
- func Sleep(second time.Duration)
- func StructToMap(obj interface{}) map[string]interface{}
- func StructToMapByTag(obj interface{}, tag string) map[string]interface{}
- func SubStr(str string, begin, length int) (substr string)
- func ToJSON(dstr string, data interface{}) error
- func ToStr(dval interface{}) string
- func UTF8ToGBK(data string) (string, error)
- func UpdateMap(ac MapFunc) error
- func UrlDecode(data string) map[string]string
- func UrlEncode(data map[string]string) string
- func Version() int64
- func XSSHandleStruct(data interface{}, tag string, field []string) error
- type AcLimiter
- type AcRate
- type ActionFunc
- type Breaker
- type LazyHandler
- type LazyTopics
- type LazyTopics2
- type MapFunc
- type RateInter
- type RateKeyFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapToStruct ¶
MapToStruct MapToStruct
func ObjectIDCounter ¶
func StructToMapByTag ¶
StructToMapByTag StructToMapByTag
func XSSHandleStruct ¶
XSSHandleStruct 对struct的指定字段进行xss过滤
Types ¶
type AcRate ¶
type AcRate struct {
// contains filtered or unexported fields
}
func (*AcRate) SetKeyFunc ¶
func (h *AcRate) SetKeyFunc(ac RateKeyFunc)
type ActionFunc ¶
type ActionFunc func() error
type Breaker ¶
type Breaker struct { CircuitRate float64 //熔断的成功率 // contains filtered or unexported fields }
type LazyHandler ¶
LazyHandler handler
type LazyTopics ¶
type LazyTopics struct {
// contains filtered or unexported fields
}
LazyTopics topics
func NewTopics ¶
func NewTopics(batch, goroutine int, action LazyHandler) *LazyTopics
NewTopics new lazy
type LazyTopics2 ¶
type LazyTopics2 struct {
// contains filtered or unexported fields
}
LazyTopics topics
func NewTopics2 ¶
func NewTopics2(batch, goroutine int, action LazyHandler) *LazyTopics2
NewTopics new lazy
type RateKeyFunc ¶
type RateKeyFunc func() interface{}
Click to show internal directories.
Click to hide internal directories.