Documentation ¶
Index ¶
- Variables
- func AllKey(skmap map[string]interface{}) []string
- func AllKeyRegexQuery(filter string, sta interface{}) bson.M
- func AllStructKey(sta interface{}) []string
- func AnyHasSuffix(s string, suffixlist []string) bool
- func BetweenIP(ipsrt1 string, ipstr2 string) []string
- func DeleteElementInSlient(sl []string, s string) []string
- func DloadFilePath(propath string) string
- func FindSub(strlist []string, str string) string
- func GenRsaKey(bits int) error
- func GetCwd() string
- func GetFileMD5Hash(filepath string) string
- func GetPassword(key string) uint32
- func GetValue(skmap map[string]interface{}, key string) interface{}
- func IP2Int(ipnr net.IP) int64
- func Int2IP(ipnr int64) net.IP
- func InterfaceSlice2BsonM(slice []interface{}) []bson.M
- func IsDevMode() bool
- func KeyDecode(encodeStr string) string
- func KeyEncode(key string) string
- func KeyType(key string, value string) interface{}
- func Last7DateStr(timeformat string) []string
- func Loginit(logfile string)
- func MapSearch(ml []bson.M, key string, value interface{}) map[string]interface{}
- func MapUpdate(ori map[string]interface{}, sub map[string]interface{}) map[string]interface{}
- func Md5String(str string) string
- func NetIP2String(ip net.IP) string
- func PPrintBsonM(obj interface{})
- func PPrintMap(mlist ...map[string]interface{})
- func ParseBsonM(obj interface{}) string
- func RStrip(s string, suffixlist []string) string
- func RandStringBytesMaskImprSrc(n int) string
- func ReverseStrList(slice []string) []string
- func Round(f float64, n int) float64
- func SplitStrToMap(str string, sep1 string, sep2 string) map[string]string
- func String2NetIP(ipstr string) net.IP
- func StringInSlice(a string, list []string) bool
- func TCPAlive(server string) bool
- func ToBsonMSlice(itf interface{}) []bson.M
- func TodayRounded() time.Time
- func ValueInListMap(str string, listmap map[string][]string) string
- type ElasticSearch
- func (es ElasticSearch) Count(indexs []string, query []byte) float64
- func (es ElasticSearch) CountAllMonitor() float64
- func (es ElasticSearch) LastSecMonitorData(ip string, second int) interface{}
- func (es ElasticSearch) Search(indexs []string, mode string, query []byte) bson.M
- func (es ElasticSearch) SearchByJSON(indexs []string, query bson.M) bson.M
- func (es ElasticSearch) SearchInMonitor(query []byte) bson.M
- type Paginator
Constants ¶
This section is empty.
Variables ¶
var Logger = logs.NewLogger()
Logger log
Functions ¶
func AllKeyRegexQuery ¶
AllKeyRegexQuery 为结构体定义所有key添加搜索模糊搜索条件
func AnyHasSuffix ¶
AnyHasSuffix change HasSuffix function in any element
func DeleteElementInSlient ¶
DeleteElementInSlient as name
func DloadFilePath ¶
DloadFilePath relative dload path to abs path
func GetFileMD5Hash ¶
GetFileMD5Hash return MD5 hex string from file
func GetPassword ¶
GetPassword create password like "google auth"
func InterfaceSlice2BsonM ¶
InterfaceSlice2BsonM 对interface{}的切片进行类型转换
func Last7DateStr ¶
Last7DateStr get formated date string list in last seven day
func PPrintMap ¶
func PPrintMap(mlist ...map[string]interface{})
PPrintMap Petty Print Golang Map Struct
func RandStringBytesMaskImprSrc ¶
RandStringBytesMaskImprSrc return random string
func ReverseStrList ¶
ReverseStrList Reverse a strings slice
func SplitStrToMap ¶
SplitStrToMap Split string to map[string]string
func StringInSlice ¶
StringInSlice check string is a element of slice
func ToBsonMSlice ¶
ToBsonMSlice interface{} to []bson.M
Types ¶
type ElasticSearch ¶
type ElasticSearch struct {
// contains filtered or unexported fields
}
ElasticSearch struct
func (ElasticSearch) Count ¶
func (es ElasticSearch) Count(indexs []string, query []byte) float64
Count count in es search
func (ElasticSearch) CountAllMonitor ¶
func (es ElasticSearch) CountAllMonitor() float64
CountAllMonitor count all data in index monitor
func (ElasticSearch) LastSecMonitorData ¶
func (es ElasticSearch) LastSecMonitorData(ip string, second int) interface{}
Last3SecMonitorData request /monitor/_search "gte":"now-ns"
func (ElasticSearch) SearchByJSON ¶
SearchByJSON call search by bson.M
func (ElasticSearch) SearchInMonitor ¶
func (es ElasticSearch) SearchInMonitor(query []byte) bson.M
SearchInMonitor request /monitor/_search