package
0.0.18
Repository: https://github.com/wentaojin/dbms.git
Documentation: pkg.go.dev

# Functions

Abs returns the absolute path.
AnySliceSplit used for the according to splitCounts, split slice.
BytesToString used for bytes to string, reduce memory https://segmentfault.com/a/1190000037679588.
CharsetConvert used for string data charset convert.
Checksum returns the sha1 sum of target file.
No description provided by the author
Key-Value.
ConvertTimeToSeconds Converts a time interval string to a number of seconds.
Copy copies a file or directory from src to dst.
CreateDir used to create dir.
CurrentTimeFormatString used for format time string.
No description provided by the author
No description provided by the author
EscapeBinaryCSV used for bytes to string.
No description provided by the author
ExchangeStringDict used for exchange string dict.
FlattenMap convert mutil-layer map to single layer.
FoldMap convert single layer map to multi-layer.
FormatJSONFields returns format json string.
GetDiskUsage used for get the current dir disk usage size.
GetJSONTagFieldValue used for get field value with json tag.
GetOutBoundIP used for the host ipaddr.
GetRandomElem used for get random element.
No description provided by the author
HostWhiteListForInitialCluster remove duplicate addr, returns addr.
IsContainedString used for judge items whether is contained the item, and if it's contained, return true.
IsContainedStringIgnoreCase used for judge items whether is contained the item, and if it's contained, return true.
IsDirExist returns whether the directory is exists.
IsPathExist check whether a path is exist.
IsPathNotExist check whether a path is not exist.
IsSubDir returns if sub is a sub directory of parent.
No description provided by the author
JoinHostPort return host and port.
JoinInt joins a slice of int to string.
LogDigitWidth calculates the number of digits of a given positive integer.
MarshalIndentJSON returns marshal indent object json.
MarshalJSON returns marshal object json.
No description provided by the author
Merge2TomlConfig merge the config of global.
MergeConfig merge two or more config into one and unflat them config1: a.b.a: 1 a.b.b: 2 config2: a.b.a: 3 a.b.c: 4 config3: b.c = 5 After MergeConfig(config1, config2, config3): a: b: a: 3 b: 2 c: 4 b: c: 5.
No description provided by the author
MkdirAll basically copied from os.MkdirAll, but use max(parent permission,minPerm).
MultiDirAbs returns the absolute path for multi-dir separated by comma.
NewStringSet builds a string set.
OpenFileInEditor opens filename in a text editor.
OsArch builds an "os/arch" string from input, it converts some similar strings to different words to avoid misreading when displaying in terminal.
PackagePath return the tar bar path.
No description provided by the author
PathNotExistOrCreate used for the filepath is whether exist, if not exist, then create.
No description provided by the author
No description provided by the author
PrintTable accepts a matrix of strings and print them as ASCII table to terminal.
Prompt accepts input from console by user.
PromptForAnswerOrAbortError accepts string from console by user, generates AbortError if user does not input the pre-defined answer.
PromptForConfirmAnswer accepts string from console by user, default to empty and only return true if the user input is exactly the same as pre-defined answer.
PromptForConfirmNo accepts yes / no from console by user, default to Yes and only return true if the user input is No.
PromptForConfirmOrAbortError accepts yes / no from console by user, generates AbortError if user does not input yes.
PromptForConfirmYes accepts yes / no from console by user, default to No and only return true if the user input is Yes.
PromptForPassword reads a password input from console.
RemoveAllDir used to remove dir.
No description provided by the author
No description provided by the author
No description provided by the author
ReplaceQuestionPlacholders replaces ? marks with support placeholders.
SaveFileWithBackup will backup the file before save it.
ShowDiff write diff result into the Writer.
If there are special characters, add \ directly before the special characters.* Determine whether it is a letter: unicode.IsLetter(v) Determine whether it is a decimal number: unicode.IsDigit(v) Determine whether it is a number: unicode.IsNumber(v) Determine whether it is a white space symbol: unicode.IsSpace(v) Determine whether it is a special symbol: unicode.IsSymbol(v) Determine whether it is a Unicode punctuation character: unicode.IsPunct(v) Determine whether it is Chinese: unicode.Han(v) */.
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
StringBuilder used for string builder, and returns string.
No description provided by the author
No description provided by the author
No description provided by the author
StringItemsFilterDifference used for filter difference items, and returns new array string.
StringItemsFilterIntersection used for filter intersection items in the two items, and return new array string.
StringJoin used for string join, and returns array string.
StringLower used for string lower, and returns lower string.
StringLowerSlice used for string slice lower, and returns lower string.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
StringSliceRemoveElement used for string slice remove element.
StringSliceSplit used for the according to splitCounts, split slice.
StringSplit used for string split, and returns array string.
No description provided by the author
StringUpper used for string upper, and returns upper string.
StringUpperSlice used for string slice upper, and returns upper string.
Ternary operator.
TrimIfBothExist Determine whether a specific character exists at the beginning and end of the string, and if so, remove these characters.
UnmarshalJSON returns marshal object json.
UnwrapScheme removes http or https scheme from input.
UppercaseMap recursively converts all string keys and values within a map to uppercase.
ValidateSpecDiff checks and validates the new spec to see if the modified keys are all marked as editable.
No description provided by the author
VersionOrdinal used for the database version comparison.
WithHostPort returns addr with host port.
WrapPrefixIPName returns the name with ip and prefix.
No description provided by the author
WrapSchemes adds http or https scheme to input if missing.
WrapSchemesForInitialCluster acts like WrapSchemes, except input is "name=URL,...".
WriteFile call os.WriteFile, but use max(parent permission,minPerm).

# Constants

pre-defined ascii art strings.
DefaultEditor is vi because we're adults ;).

# Type aliases

StringSet is a string set.