package
0.0.0-20220420091620-9a109683b971
Repository: https://github.com/dan-drl/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");.

# Functions

AddTags appends a tag to the tags field of ms.
AutoGetAddress get valid address to listen, if the specify port is not available, auto choose the next one.
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
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.
CheckProcessExists check if the pid is running.
ClearInstanceLock remove the lock.
No description provided by the author
No description provided by the author
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.
ExecuteRequest issue a request.
ExecuteRequestWithContext issue a request with context.
No description provided by the author
No description provided by the author
No description provided by the author
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.
FileMTime get file modified time.
FilePutContent put string to file.
FilePutContentWithByte put string to file.
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
FromJSONBytes simply do json unmarshal.
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.
helper function to create a cert template with a serial number and other required fields.
No description provided by the author
GetFieldValueByTagName return the field value which field was tagged with this tagName, only support string field.
GetHost return the host from a url.
GetIncrementID return incremented id in specify bucket.
No description provided by the author
No description provided by the author
GetLocalZone return a local timezone.
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
GetUUID return a generated uuid.
GetValidAddress get valid address, input: :8001 -> output: 127.0.0.1:8001.
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
Invoke dynamic execute function via function name and parameters.
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
IsValidTLD returns true if tld is a valid tld, eg: com.
JoinPath return joined file path.
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
MergeFields merges the top-level keys and values in each source map (it does not perform a deep merge).
Removes all unnecessary whitespaces.
NewDeleteRequest issue a simple http delete request.
NewGetRequest issue a simple http get request.
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
PickRandomName return a random name.
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
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
SnapshotPersistID will make a snapshot and persist id stats to disk.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TestListenPort check availability of port with ip.
TestPort check port availability.
ToBytes parses a string formatted by ByteSize as bytes.
No description provided by the author
No description provided by the author
ToJSONBytes convert interface to json with byte array.
ToLowercase convert string bytes to lowercase.
ToMegabytes parses a string formatted by ByteSize as megabytes.
ToUppercase convert string bytes to uppercase.
No description provided by the author
TrimSpaces will trim space and line break.
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

# Constants

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
Event metadata constants.
ByteSize unit definition.
ByteSize unit definition.
No description provided by the author
ByteSize unit definition.
Event metadata constants.
ByteSize unit definition.
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.

# Structs

No description provided by the author
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
Result is the http request result.
No description provided by the author

# Type aliases

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