package
1.1.0
Repository: https://github.com/infinilabs/framework.git
Documentation: pkg.go.dev

# Packages

Package file copied from github.com/elastic/beatshttps://github.com/elastic/beats/blob/master/LICENSELicensed under the Apache License, Version 2.0 (the "License");.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
Abs returns the absolute value of x.
AcquireTimer returns a time.Timer from the pool and updates it to send the current time on its channel after at least timeout.
AddTags appends a tag to the tags field of ms.
AddTagsWithKey appends a tag to the key field of ms.
No description provided by the author
No description provided by the author
No description provided by the author
AutoGetAddress get valid address to listen, if the specify port is not available, auto choose the next one.
No description provided by the author
No description provided by the author
ByteSize returns a human-readable byte string of the form 10M, 12.5K, and so forth.
No description provided by the author
No description provided by the author
No description provided by the author
BytesToUint32 convert bytes to uint32.
BytesToUint64 convert bytes to type uint64.
CheckInstanceLock make sure there is not a lock placed before check, and place a lock after check.
No description provided by the author
CheckProcessExists check if the pid is running.
No description provided by the author
ClearInstanceLock remove the lock.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
convert a->b to a,b.
source should be a struct, target should be a pointer to the struct.
CopyFile copy file from src to dst.
No description provided by the author
CreateFile create file.
DeepCopy return a deep copied object.
No description provided by the author
No description provided by the author
No description provided by the author
escape "\r\n" to "\\n".
ExecuteRequest issue a request.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ExtractBool extracts a bool from an unknown type.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ExtractFloat extracts a float from an unknown type.
ExtractInt extracts an int from an unknown type.
ExtractString extracts a string from an unknown type.
FileAppendContentWithByte append bytes to the end of the file.
FileAppendNewLine append new line to the end of the file.
FileAppendNewLineWithByte append bytes and break line(\n) to the end of the file.
FileDelete delete file.
FileExists check if the path are exists.
FileExtension extract file extension from file name.
FileGetContent get string from text file.
No description provided by the author
No description provided by the author
FileMTime get file modified time.
FilePutContent put string to file.
FilePutContentWithByte put string to file.
No description provided by the author
FileSize get file size as how many bytes.
FilterDirName guess the file or directory is or contains Go source files.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
RSA公钥私钥产生.
No description provided by the author
No description provided by the author
No description provided by the author
GetAvailablePort get valid port to listen, if the specify port is not available, auto choose the next one.
No description provided by the author
No description provided by the author
helper function to create a cert template with a serial number and other required fields.
No description provided by the author
No description provided by the author
return field and tags, field name is using key: NAME.
GetFieldValueByTagName returns the field value which field was tagged with the specified tagName, only supporting string fields.
GetHost return the host from a url.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GetLocalIP returns the non loopback local IP of the host.
GetLocalZone return a local timezone.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GetRootUrl parse to get url root.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GetUUID return a generated uuid.
GetValidAddress get valid address, input: :8001 -> output: 127.0.0.1:8001.
No description provided by the author
gzip.BestCompression.
No description provided by the author
No description provided by the author
HttpDelete issue a simple http delete request.
HttpGet issue a simple http get request.
HttpGetWithCookie issue http request with cookie.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Invoke dynamic execute function via function name and parameters.
No description provided by the author
No description provided by the author
No description provided by the author
IsExist returns whether a file or directory exists.
IsFile returns false when it's a directory or does not exist.
No description provided by the author
IsLocalAddress check if the address is local address.
No description provided by the author
No description provided by the author
No description provided by the author
IsValidTLD returns true if tld is a valid tld, eg: com.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
JoinPath return joined file path.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MapStrUnion creates a new MapStr containing the union of the key-value pairs of the two maps.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MergeFields merges the top-level keys and values in each source map (it does not perform a deep merge).
Removes all unnecessary whitespaces.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MustFromJSONBytes simply do json unmarshal.
MustParseGeneric is like ParseGeneric except that it panics on error.
MustParseSemantic is like ParseSemantic except that it panics on error.
MustParseTime is a convenience equivalent of the ParseTime function that panics in case of errors.
No description provided by the author
No description provided by the author
fmt.Println(num, " = ", NearestThousandFormat(float64(num)))10 = 10100 = 1001000 = 1.0k10000 = 10.0k3.12345678912e+09 = 3.1b999.4 = 999-372712 = -372.7k-37271922 = -37.2m-198 = -198.
NewCache creates and returns a new Cache.
NewCacheWithExpireOnAdd creates and returns a new Cache that does not updated the expiration time when the object is accessed.
NewCacheWithRemovalListener creates and returns a new Cache and register a RemovalListener callback function.
NewDeleteRequest issue a simple http delete request.
NewGetRequest issue a simple http get request.
NewMapStrPointer initializes and returns a pointer to the given MapStr.
NewPostRequest issue a simple http post request.
NewPutRequest issue a simple http put request.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ParseGeneric parses a "generic" version string.
No description provided by the author
ParseSemantic parses a version string that exactly obeys the syntax and semantics of the "Semantic Versioning" specification (http://semver.org/) (although it ignores leading and trailing whitespace, and allows the version to be preceded by "v").
No description provided by the author
No description provided by the author
ParseTime parses a time in the TsLayout format.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Post
Post http post with a list of values.
No description provided by the author
No description provided by the author
No description provided by the author
[]byte("gte"), []byte("strict_date_optional_time"), []byte("range")blockSplit 按照那个部分来进行划分多个区块;validBlockMustContain 区块必须包含的关键字reverse 是从区块的前面还是后面进行处理processBlockStartWithBlock 从什么地方开始处理processBlockEndWithBlock 从什么地方结束处理maxSpan 开始和结束位置的最大间隔,约束范围匹配位置的处理函数.
PromptYesNo Returns true if the user has entered Y or YES, capitalization is ignored, we are matching elasticsearch behavior.
No description provided by the author
ReadInput Capture user input for a question.
No description provided by the author
ReleaseTimer returns the time.Timer acquired via AcquireTimer to the pool and prevents the Timer from firing.
No description provided by the author
Rename handle file rename.
TODO optimize performanceReplaceByte simply replace old bytes to new bytes, the two bytes should have same length.
RestorePersistID will take the snapshot and restore to id seeds.
No description provided by the author
No description provided by the author
credit to https://github.com/DeyV/gotools/blob/master/numbers.go.
私钥解密.
公钥加密.
签名.
验证.
No description provided by the author
No description provided by the author
No description provided by the author
SnapshotPersistID will make a snapshot and persist id stats to disk.
sort by value desc by default.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
StringToFloat converts a string to a float64 Returns an error if the conversion is not possible.
No description provided by the author
No description provided by the author
Advanced Unicode normalization and filtering, see http://blog.golang.org/normalization and http://godoc.org/golang.org/x/text/unicode/norm for more details.
No description provided by the author
two byte-oriented functions identical except for operator comparing c to 127.
two UTF-8 functions identical except for operator comparing c to 127.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TestListenOnTCPPort check availability of port with ip.
TestPort check port availability.
No description provided by the author
No description provided by the author
ToBytes parses a string formatted by ByteSize as bytes.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ToLowercase convert string bytes to lowercase.
ToMegabytes parses a string formatted by ByteSize as megabytes.
No description provided by the author
ToUppercase convert string bytes to uppercase.
No description provided by the author
No description provided by the author
TrimSpaces will trim space and line break.
Smart get file abs path.
No description provided by the author
No description provided by the author
Uint32toBytes convert uint32 to bytes, max uint: 4294967295.
Uint64toBytes convert uint64 to bytes.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
ByteSize unit definition.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Event metadata constants.
No description provided by the author
ByteSize unit definition.
No description provided by the author
ByteSize unit definition.
No description provided by the author
No description provided by the author
ByteSize unit definition.
No description provided by the author
Event metadata constants.
No description provided by the author
ByteSize unit definition.
TsLayout is the layout to be used in the timestamp marshaling/unmarshaling everywhere.
No description provided by the author
No description provided by the author
No description provided by the author
Verb_POST
No description provided by the author
No description provided by the author

# Variables

ErrKeyNotFound indicates that the specified key was not found.
No description provided by the author
Prometheus metric name rule: [a-zA-Z_:][a-zA-Z0-9_:]* See https://prometheus.io/docs/concepts/data_model/.
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
Cache is a semi-persistent mapping of keys to values.
No description provided by the author
EventMetadata contains fields and tags that can be added to an event via configuration.
No description provided by the author
No description provided by the author
MapStrPointer stores a pointer to atomically get/set a MapStr object This should give faster access for use cases with lots of reads and a few changes.
No description provided by the author
No description provided by the author
Result is the http request result.
No description provided by the author
Version is an opaque representation of a version number.

# Interfaces

Key type used in the cache.
Value type held in the cache.

# Type aliases

No description provided by the author
No description provided by the author
MapStr is a map[string]interface{} wrapper with utility methods for common map operations like converting to JSON.
No description provided by the author
RemovalListener is the callback function type that can be registered with the cache to receive notification of the removal of expired elements.
No description provided by the author
Time is an abstraction for the time.Time type.