gitlab.com/evatix-go/core@v1.3.55/constants/constants.go (about) 1 package constants 2 3 import ( 4 "math" 5 "os" 6 "time" 7 ) 8 9 const ( 10 EmptyString = "" 11 EmptyArray = "[]" 12 FirstItemEmptyStringArray = "[\"\"]" 13 EmptyStatus = "Empty Status" 14 FilePath = "File Path" 15 DirectoryPath = "Directory Path" 16 Dot = "." 17 UpperCaseA = 'A' 18 UpperCaseZ = 'Z' 19 LowerCaseA = 'a' 20 LowerCaseZ = 'z' 21 LowerCase = LowerCaseA - UpperCaseA // c - 'A' + 'a' (ref: https://bit.ly/3mFnUPW) 22 UpperCase = UpperCaseA - LowerCaseA // c - 'a' + 'A' 23 NewLineMac = "\n" 24 NewLineUnix = "\n" 25 DefaultLine = "\n" 26 NewLineHyphenSpace = DefaultLine + HyphenSpace 27 NewLineEqualSpace = DefaultLine + "= " 28 NewLineWindows = "\r\n" 29 Tab = "\t" 30 TabV = "\v" 31 Hash = "#" 32 DoubleHash = "##" 33 TripleHash = "###" 34 HashSpace = "# " 35 DoubleHashSpace = "## " 36 Space = " " 37 Hyphen = "-" 38 Semicolon = ";" 39 Comma = "," 40 CommaUnixNewLine = ",\n" 41 CommaSpace = ", " 42 CsvJoiner = CommaSpace 43 SpaceColonSpace = " : " 44 Pipe = "|" 45 QuestionMarkSymbol = "?" 46 NilString = "nil" 47 EqualSymbol = "=" 48 DoubleEqualSymbol = "==" 49 TripleEqualSymbol = "===" 50 NotEqualSymbol = "!=" 51 JsNotEqualSymbol = "!==" 52 SqlNotEqualSymbol = "<>" 53 LeftLessSymbol = "<" 54 LeftLessEqualSymbol = "<=" 55 LeftGreaterSymbol = ">" 56 LeftGreaterEqualSymbol = ">=" 57 InvalidNotFoundCase = -1 58 Zero = 0 59 NotImplemented = "Not Implemented" 60 SingleQuoteSymbol byte = '\'' 61 DoubleQuoteSymbol byte = '"' 62 SingleQuoteStringSymbol = "'" 63 DoubleQuoteStringSymbol = "\"" 64 DoubleDoubleQuoteStringSymbol = "\"\"" 65 ParenthesisStartSymbol byte = '(' 66 ParenthesisEndSymbol byte = ')' 67 CurlyStartSymbol byte = '{' 68 CurlyEndSymbol byte = '}' 69 SquareStartSymbol byte = '[' 70 SquareEndSymbol byte = ']' 71 LineFeedUnix = '\n' 72 CarriageReturn = '\r' 73 FormFeed = '\f' 74 SpaceByte = ' ' 75 TabByte = '\t' 76 LineFeedUnixByte = '\n' 77 CarriageReturnByte = '\r' 78 FormFeedByte = '\f' 79 TabVByte = '\v' 80 MaxUnit8 byte = 255 81 OtherPathSeparator = "/" 82 WindowsPathSeparator = "\\" 83 WindowsOS = "windows" 84 LowerCaseFileColon = "file:" 85 DoubleBackSlash = "\\\\" 86 TripleBackSlash = "\\\\\\" 87 BackSlash = "\\" 88 DoubleForwardSlash = "//" 89 TripleForwardSlash = "///" 90 BackwardAndForwardSlashes = "\\//" 91 ForwardSlash = "/" 92 UriSchemePrefixStandard = "file:///" 93 UriSchemePrefixTwoSlashes = "file://" 94 Underscore = "_" 95 Colon = ":" 96 Dash = "-" 97 DoubleDash = "--" 98 DoubleUnderscore = "__" 99 HyphenAngelRight = "->" 100 GoPath = "GOPATH" 101 GoBinPath = "GOBIN" 102 Go111ModuleEnvironment = "GO111MODULE" 103 On = "on" 104 PathSeparator = string(os.PathSeparator) 105 DoublePathSeparator = PathSeparator + PathSeparator 106 Dollar = "$" 107 DoubleDollar = "$$" 108 Percent = "%" 109 DoublePercent = "%%" 110 One = 1 111 SemiColon = ";" 112 Path = "PATH" 113 Unix = "Unix OS" 114 Windows = "Windows OS" 115 SymbolicLinkCreationCommandName = "ln" 116 SymbolicLinkCreationArgument = "-s" 117 Architecture64 = "X64" 118 Architecture32 = "X32" 119 LongPathUncPrefix = `\\?\UNC\` 120 LongPathQuestionMarkPrefix = `\\?\` 121 SingleHash = "#" 122 EndOfBlock = "}" 123 EndOfLineMark = ";" 124 StartOfBlock = "{" 125 MinusOne = -1 126 InvalidValue = -1 127 InvalidIndex = -1 128 InvalidLineNumber = -1 129 TakeAllMinusOne = -1 130 NoLimits = -1 131 DontCompare = -1 132 WildcardSymbol = "*" 133 WildcardChar = '*' 134 WildcardRune rune = '*' 135 ParenthesisStart = "(" 136 ParenthesisEnd = ")" 137 CurlyStart = "{" 138 CurlyEnd = "}" 139 SquareStart = "[" 140 SquareEnd = "]" 141 ZeroChar byte = '0' 142 NineChar byte = '9' 143 HyphenChar byte = '-' 144 MaxUnit8Rune rune = 255 145 MaxUnit8AsInt16 int16 = 255 146 MaxUnit8AsInt int = 255 147 MaxInt16 = math.MaxUint16 148 MaxInt16AsInt int = math.MaxUint16 149 MaxUnit8AsFloat32 float32 = 255 150 ParenthesisStartRune rune = '(' 151 ParenthesisEndRune rune = ')' 152 CurlyStartRune rune = '{' 153 CurlyEndRune rune = '}' 154 SquareStartRune rune = '[' 155 SquareEndRune rune = ']' 156 ZeroRune rune = '0' 157 NineRune rune = '9' 158 HyphenRune rune = '-' 159 UpperCaseARune rune = 'A' 160 UpperCaseZRune rune = 'Z' 161 LowerCaseARune rune = 'a' 162 LowerCaseZRune rune = 'z' 163 LowerCaseRune rune = LowerCaseA - UpperCaseA // c - 'A' + 'a' (ref: https://bit.ly/3mFnUPW) a - A = 32 also works 164 UpperCaseRune = UpperCaseARune - LowerCaseARune // c - 'a' + 'A' 165 NoElements = "{No Element}" 166 NoItems = "{No Items}" 167 NoItemsSquare = "[No Items]" 168 NoElementsSquare = "[No Element]" 169 DoubleNewLine = "\n\n" 170 DefaultLineByte byte = '\n' 171 DotSymbol = "." 172 DotChar byte = '.' 173 ForwardChar byte = '/' 174 BackwardChar byte = '\\' 175 AndChar byte = '&' 176 PipeChar byte = '|' 177 ParenthesisStartChar byte = '(' 178 ParenthesisEndChar byte = ')' 179 CurlyBraceStartChar byte = '{' 180 CurlyBraceEndChar byte = '}' 181 SquareBraceStartChar byte = '[' 182 SquareBraceEndChar byte = ']' 183 AngleStartChar byte = '<' 184 AngleEndChar byte = '>' 185 QuestionChar byte = '?' 186 CommaChar byte = ',' 187 ExclamationChar byte = '!' 188 HashChar byte = '#' 189 DollarChar byte = '$' 190 AsteriskChar byte = '*' 191 WildcardStarChar byte = '*' 192 PlusChar byte = '+' 193 MinusChar byte = '-' 194 UnderscoreChar byte = '_' 195 SingleQuoteChar byte = '\'' 196 DoubleQuoteChar byte = '"' 197 ColonChar byte = ':' 198 SemicolonChar byte = ';' 199 SpaceChar byte = ' ' 200 AtChar byte = '@' 201 EqualChar byte = '=' 202 LeftLessChar byte = '<' 203 LeftGreaterChar byte = '>' 204 DotRune rune = '.' 205 ForwardRune rune = '/' 206 BackwardRune rune = '\\' 207 AndRune rune = '&' 208 PipeRune rune = '|' 209 CurlyBraceStartRune rune = '{' 210 CurlyBraceEndRune rune = '}' 211 SquareBraceStartRune rune = '[' 212 SquareBraceEndRune rune = ']' 213 AngleStartRune rune = '<' 214 AngleEndRune rune = '>' 215 QuestionRune rune = '?' 216 CommaRune rune = ',' 217 ExclamationRune rune = '!' 218 HashRune rune = '#' 219 DollarRune rune = '$' 220 AsteriskRune rune = '*' 221 PlusRune rune = '+' 222 MinusRune rune = '-' 223 UnderscoreRune rune = '_' 224 SingleQuoteRune rune = '\'' 225 DoubleQuoteRune rune = '"' 226 AtRune rune = '@' 227 ColonRune rune = ':' 228 SemicolonRune rune = ';' 229 SpaceRune rune = ' ' 230 EqualRune rune = '=' 231 LeftLessRune rune = '<' 232 LeftGreaterRune rune = '>' 233 MinusTwo = -2 234 MinusThree = -3 235 MinusFour = -4 236 Two = 2 237 Three = 3 238 Four = 4 239 Five = 5 240 Six = 6 241 Seven = 7 242 Eight = 8 243 Nine = 9 244 Ten = 10 245 AsteriskSymbol = "*" 246 PlusSymbol = "+" 247 TildeSymbol = "~" 248 TildeChar byte = '~' 249 TildeRune rune = '~' 250 BrokenLongPathUncPrefix = `\?\UNC\` 251 BrokenLongPathQuestionMarkPrefix = `\?\` 252 N0 = 0 253 N1 = 1 254 N2 = 2 255 N3 = 3 256 N4 = 4 257 N5 = 5 258 N6 = 6 259 N7 = 7 260 N8 = 8 261 N9 = 9 262 N10 = 10 263 N11 = 11 264 N12 = 12 265 N13 = 13 266 N14 = 14 267 N15 = 15 268 N16 = 16 269 N17 = 17 270 N18 = 18 271 N19 = 19 272 N20 = 20 273 N21 = 21 274 N22 = 22 275 N23 = 23 276 N24 = 24 277 N25 = 25 278 N26 = 26 279 N27 = 27 280 N28 = 28 281 N29 = 29 282 N30 = 30 283 N31 = 31 284 N32 = 32 285 DistributorID = "Distributor ID" 286 Description = "Description" 287 Release = "Release" 288 Codename = "Codename" 289 HyphenA = "-a" 290 UnameArgForReleaseInfo = "-r" 291 ArgumentForReleaseDate = "-v" 292 LsbCommand = "lsb_release" 293 UnameCommand = "uname" 294 Shell = "sh" 295 Bash = "bash" 296 BinShellCmd = "/bin/sh" 297 Etc = "/etc/" 298 ShellCmdline = "sh" 299 PerlCmdline = "perl" 300 MakeCmdline = "make" 301 Pwsh = "pwsh" 302 Cmd = "cmd" 303 HypenC = "-c" 304 Cd = "cd" 305 Pwd = "pwd" 306 BashDefaultPath = "/bin/bash" 307 BashCommandline = "bash" 308 NonInteractiveFlag = "-c" 309 NonInteractiveCmdFlag = "/c" 310 NonInteractivePerlFlag = "-e" 311 ChmodCommand = "chmod" 312 RecursiveCommandFlag = "-R" 313 VersionCommandForCmd = "ver.exe" 314 CompareEqual = 0 315 CompareLess = -1 316 CompareGreater = 1 317 NilAngelBracket = "<nil>" 318 CommaRawValueColonSpace = ", value: " 319 IndexColonSpace = "index: " 320 CommaIndexColonSpace = ", index: " 321 N0String = "0" // N refers to number 322 N1String = "1" 323 N2String = "2" 324 N3String = "3" 325 N4String = "4" 326 N5String = "5" 327 N6String = "6" 328 N7String = "7" 329 N8String = "8" 330 N9String = "9" 331 N10String = "10" 332 MaxUint = ^uint(0) // https://stackoverflow.com/a/6878625 333 MinUint = 0 334 MaxInt = int(MaxUint >> 1) // https://stackoverflow.com/a/6878625, 64 bit 9223372036854775807, 32bit, 2147483647 335 MinInt = -MaxInt - 1 336 NewLineUnixChar byte = '\n' 337 NewLineUnixRune rune = '\n' 338 DefaultRangesJoiner = ", " 339 DoubleQuotationStartEnd = `""` 340 DoubleQuotation = `"` 341 SingleQuotationStartEnd = `''` 342 SingleQuotation = `'` 343 Backtick = "`" 344 BacktickStartEnd = "``" 345 BacktickSymbol = '`' 346 BacktickRuneSymbol rune = '`' 347 CodeQuotation = "`" 348 CodeQuotationStartEnd = "``" 349 SpaceWithColon = " : " 350 CurrentDirDot = Dot 351 InQuerySuffix = " IN (?)" 352 SslPort = 443 353 PublicPort = 80 354 Common8080Port = 8080 355 SpaceHyphenSpace = " - " 356 HyphenSpace = "- " 357 SpaceEqualSpace = " = " 358 SpacePipeSpace = " | " 359 SpaceUnderscoreSpace = " _ " 360 SpaceColonEqualSpace = " := " 361 SpaceCommaSpace = " , " 362 NewLineSpaceHyphenSpace = "\n - " 363 NewLineSpaceEqualSpace = "\n = " 364 NewLineSpacePlusSpace = "\n + " 365 SpaceHyphenAngelBracketSpace = " -> " 366 NonAsyncSafeRangeSmall = 15 367 NonAsyncSafeRangeMedium = 50 368 NonAsyncSafeRangeLarge = 100 369 FileInfoEachLineJoiner = ",\n - " 370 IndentFileInfoEachLineJoiner = "\n - " 371 PrefixKeyword = "prefix" 372 RelativeKeyword = "relative" 373 IdKeyword = "id" 374 OnKeyword = "on" 375 OffKeyword = "off" 376 FileKeyword = "file" 377 LogFileKeyword = "log-file" 378 HomeKeyword = "home" 379 UserKeyword = "user" 380 AppKeyword = "app" 381 TmpKeyword = "tmp" 382 WrappedTemplate = "{wrapped}" 383 BracketsWrappedTemplate = "{brackets-wrapped}" 384 QuotesWrappedTemplate = "{quotes-wrapped}" 385 SingleQuotesWrappedTemplate = "{single-quotes-wrapped}" 386 DoubleQuotesWrappedTemplate = "{double-quotes-wrapped}" 387 BacktickQuotesWrappedTemplate = "{backtick-quotes-wrapped}" 388 ParenthesisWrappedTemplate = "{parenthesis-wrapped}" 389 SquareWrappedTemplate = "{square-wrapped}" 390 CurlyWrappedTemplate = "{curly-wrapped}" 391 DynamicTemplate = "{dynamic}" 392 DynamicTemplateTemplate = "{dynamic-template}" 393 RandomTemplate = "{random}" 394 InjectTemplate = "{inject-template}" 395 ValueTemplate = "{value}" 396 ValueWithFieldsTemplate = "{value-fields}" 397 ValueJsonTemplate = "{value-json}" 398 ValueYamlTemplate = "{value-yaml}" 399 PathPrefixTemplate = "{prefix}" 400 PathRelativeTemplate = "{relative}" 401 PathIdTemplate = "{id}" 402 PathLogFileTemplate = "{log-file}" 403 PathFileTemplate = "{file}" 404 PathRootTemplate = "{root}" 405 PathHomeTemplate = "{home}" 406 PathUserTemplate = "{user}" 407 PathRootPrefixTemplate = "{root}/{prefix}/" 408 PathHomeUserTemplate = "{home}/{user}" 409 PathHomeUserAppTemplate = "{home}/{user}/{app}" 410 PathTempDirTemplate = "{tmp}/{app}/{pkg}/" 411 PathTempTestDirTemplate = "{tmp}/{app}/{pkg}/{test}" 412 PathVarAppDirTemplate = "/var/{app}" // app 413 PathVarAppDirFileTemplate = PathVarAppDirTemplate + "/{file}" // app, file 414 PathVarLogDirTemplate = "/var/log" 415 PathVarAppLogDirTemplate = "/var/log/{app}/{log-file}" // app, log-filename 416 PrefixRelativeTemplate = "{prefix}/{relative}" // prefix, relative 417 PrefixRelativeIdTemplate = "{prefix}/{relative}/{id}" // prefix, relative, id 418 PrefixRelativeIdFileTemplate = "{prefix}/{relative}/{id}/{file}" // prefix, relative, id, file 419 PrefixRelativeFormat = "%v/%v" // prefix, relative 420 PrefixRelativeIdFormat = "%v/%v/%v" // prefix, relative, id 421 PrefixRelativeIdFileFormat = "%v/%v/%v/%v" // prefix, relative, id, file 422 KeyValShortFormat = "%s = %v" // Key, Value any 423 KeyValJsonFormat = "{key: %s, val: %v}" // Key, Value any 424 KeyValQuotationWrapJsonFormat = "\"%v\":\"%v\"" // Key, Value any 425 KeyStringValAnyWrapJsonFormat = "\"%v\":%v" // Key, Value any 426 EnumNameValueFormat = "%s[%d]" // name, value any 427 EnumDoubleQuoteNameValueFormat = "\"%s\"[%d]" // name, value any 428 StringEnumNameValueFormat = "%s" // name, value any 429 LikeQuerySuffix = " LIKE ?" 430 SpaceStartedExclamation = " started!" 431 SpaceEndedExclamation = " ended!" 432 SpaceFailedExclamation = " failed!" 433 SpaceErrorColon = " error:" 434 AndJoiner = " AND " 435 WhereClauseStart = " WHERE " 436 DoubleStars = "**" 437 Export = "export" 438 ProductName = "Cimux" 439 ProductNameLower = "cimux" 440 RedisDefaultAddress = "localhost:6379" 441 DefaultConcurrency = 10 442 DefaultMaxTrySmall = 3 443 DefaultMaxTry = 5 444 DefaultMaxTryLarge = 10 445 DefaultMaxDepth = 50 446 DefaultMaxDepthSmall = 10 447 DefaultRecursiveMaxDepth = 255 448 DefaultRecursiveMaxDepthLarge = 2048 449 DefaultMaxLevel = 8 450 DefaultMaxLevelLarge = 64 451 DefaultWait = 800 * time.Millisecond 452 DefaultWaitLong = 1 * time.Minute 453 DefaultWaitLongLong = 2 * time.Minute 454 DefaultWaitFast = 500 * time.Millisecond 455 DefaultWaitFastest = 300 * time.Millisecond 456 DurationDay = 24 * time.Hour 457 DurationWeek = 7 * DurationDay 458 DurationMinute = 1 * time.Minute 459 DurationMonth = 30 * DurationDay 460 DurationYear = 365 * DurationDay 461 SourceLower = "source" 462 Source = "Source" 463 DestinationLower = "destination" 464 Destination = "Destination" 465 FromLower = "from" 466 ToLower = "to" 467 From = "From" 468 To = "To" 469 Left = "Left" 470 Right = "Right" 471 LeftLower = "left" 472 RightLower = "right" 473 List = "List" 474 ListLower = "list" 475 ListsLower = "lists" 476 HistoryLower = "history" 477 VerboseLower = "verbose" 478 DoubleHyphen = "--" 479 VerboseFlagName = DoubleHyphen + VerboseLower 480 IncludesString = "Includes" 481 IncludeString = "Include" 482 DebugLowerString = "debug" 483 LogLowerString = "log" 484 JsonLowerString = "json" 485 AvailableLowerString = "available" 486 DefaultString = "Default" 487 AllCapitalDefaultString = "DEFAULT" 488 Localhost = "localhost" 489 LocalhostPublicPort = "localhost:80" 490 NewLineTabTab = "\n\t\t" 491 UnknownType = "Unknown type" 492 DotString = ".string" 493 DotStringTitleCase = ".String" 494 UnknownStringType = "Unknown type.String" 495 PayloadsFieldName = "Payloads" 496 )