Documentation
¶
Index ¶
- Constants
- func AreEqual(s1, s2 *string) bool
- func FixSplit(myStrings []string) []string
- func FixSplitWhite(myStrings []string) []string
- func IsAllNumber(str string) bool
- func IsAllNumbers(str ...string) bool
- func IsEmpty(s *string) bool
- func IsRuneNumber(r rune) bool
- func ParseConfig(value interface{}, filename string) error
- func Split(s string, separator ...string) []string
- func SplitN(s string, n int, separator ...string) []string
- func SplitSlice(s string, separator []string) []string
- func SplitSliceN(s string, separator []string, n int) []string
- func SplitSliceNWhite(s string, separator []string, n int) []string
- func SplitWhite(s string, separator ...string) []string
- func ToArray(strs ...string) []string
- func ToBool(str string) bool
- func ToStrSlice(qs []QString) []string
- func YesOrNo(v bool) string
- type QString
- type StrongString
- func (s *StrongString) Contains(qs ...QString) bool
- func (s *StrongString) ContainsAll(qs ...QString) bool
- func (s *StrongString) ContainsStr(str ...string) bool
- func (s *StrongString) ContainsStrAll(str ...string) bool
- func (s *StrongString) GetIndexV(index int) rune
- func (s *StrongString) GetValue() string
- func (s *StrongString) HasPrefix(values ...string) bool
- func (s *StrongString) HasPrefixes(values ...string) bool
- func (s *StrongString) HasRunePrefix(values ...rune) bool
- func (s *StrongString) HasRunePrefixes(values ...rune) bool
- func (s *StrongString) HasSuffix(values ...string) bool
- func (s *StrongString) HasSuffixes(values ...string) bool
- func (s *StrongString) IsEmpty() bool
- func (s *StrongString) IsEqual(q QString) bool
- func (s *StrongString) Length() int
- func (s *StrongString) LockSpecial()
- func (s *StrongString) Replace(qs, newS QString) QString
- func (s *StrongString) ReplaceStr(qs, newS string) QString
- func (s *StrongString) Split(qs ...QString) []QString
- func (s *StrongString) SplitFirst(qs ...QString) []QString
- func (s *StrongString) SplitN(n int, qs ...QString) []QString
- func (s *StrongString) SplitStr(qs ...string) []QString
- func (s *StrongString) SplitStrFirst(qs ...string) []QString
- func (s *StrongString) SplitStrN(n int, qs ...string) []QString
- func (s *StrongString) ToBool() bool
- func (s *StrongString) ToQString() QString
- func (s *StrongString) Trim(qs ...QString) QString
- func (s *StrongString) TrimPrefix(qs ...QString) QString
- func (s *StrongString) TrimPrefixStr(qs ...string) QString
- func (s *StrongString) TrimStr(qs ...string) QString
- func (s *StrongString) TrimSuffix(qs ...QString) QString
- func (s *StrongString) TrimSuffixStr(qs ...string) QString
- func (s *StrongString) UnlockSpecial()
Constants ¶
const ( COMMAND_PREFIX1 = "!" COMMAND_PREFIX2 = "/" SUDO_PREFIX1 = ">" FLAG_PREFIX = "--" )
the prefix values for commands.
const ( JA_Flag = "〰\u200d;〰" JA_Str = "❞\u200d;" // start character (") for string in japanese. JA_Equality = "=\u200d;" // equal character (=) in japanese. JA_Ddot = ":\u200d;" // ddot character (:) in japanese. JA_Cama = "、\u200d;" // cama character (,) in japanese. JA_RealStr = "\uff4e" // the real str JA_BrOpen = "「\u200d;" // the real str JA_BrClose = "」\u200d;" // the real str BACK_Str = `\"` BACK_Flag = `\--` BACK_Equality = `\=` BACK_Ddot = `\:` BACK_Cama = `\,` BACK_BrOpen = `\[` BACK_BrClose = `\]` )
const ( BaseIndex = 0 // number 0 BaseOneIndex = 1 // number 1 BaseTwoIndex = 2 // number 2 BaseThreeIndex = 3 // number 2 Base4Bit = 4 // number 8 Base8Bit = 8 // number 8 Base16Bit = 16 // number 16 Base32Bit = 32 // number 32 Base64Bit = 64 // number 64 BaseTimeOut = 40 // 40 seconds BaseTen = 10 // 10 seconds )
the base constant values.
const ( BaseIndexStr = "0" // number 0 BaseOneIndexStr = "1" // number 1 DotStr = "." // dot : . LineStr = "-" // line : - EMPTY = "" //an empty string. UNDER = "_" // an underscope : _ STR_SIGN = `"` // the string sign : " CHAR_STR = '"' // the string sign : '"' )
additional constants which are not actually used in this package, but may be useful in another packages.
const ( APP_PORT = "PORT" GET_SLASH = "/" HTTP_ADDRESS = ":" FORMAT_VALUE = "%v" SPACE_VALUE = " " LineEscape = "\n" R_ESCAPE = "\r" SEMICOLON = ";" CAMA = "," ParaOpen = "(" ParaClose = ")" NullStr = "null" DoubleQ = "\"" SingleQ = "'" DoubleQJ = "”" BracketOpen = "[" Bracketclose = "]" Star = "*" BackSlash = "\\" DoubleBackSlash = "\\\\" Point = "." AutoStr = "auto" AtSign = "@" EqualStr = "=" DdotSign = ":" Yes = "Yes" No = "No" TrueStr = "True" FalseStr = "False" OnStr = "On" OffStr = "Off" LowerYes = "yes" LowerNo = "no" LowerTrueStr = "true" LowerFalseStr = "false" LowerOnStr = "on" LowerOffStr = "off" OrRegexp = "|" // the or string sign: "|" )
router config values
const ( LineChar = '-' // line : '-' EqualChar = '=' // equal: '=' SpaceChar = ' ' // space: ' ' DPointChar = ':' // double point: ':' BracketOpenChar = '[' // bracket open: '[' BracketcloseChar = ']' // bracket close: ']' CamaChar = ',' // cama: ',' )
const ( JA_FLAG = "〰〰" JA_STR = "❞" // start character (") for string in japanese. JA_EQUALITY = "=" // equal character (=) for string in japanese. JA_DDOT = ":" // equal character (=) for string in japanese. BACK_STR = "\\\"" BACK_FLAG = "\\--" BACK_EQUALITY = "\\=" BACK_DDOT = "\\:" )
Variables ¶
This section is empty.
Functions ¶
func AreEqual ¶ added in v1.0.4
AreEqual will check if two string ptr are equal to each other or not.
func FixSplit ¶
FixSplit will fix the bullshit bug in the Split function (which is not ignoring the spaces between strings).
func FixSplitWhite ¶ added in v1.0.4
FixSplit will fix the bullshit bug in the Split function (which is not ignoring the spaces between strings).
func IsAllNumber ¶ added in v1.0.4
func IsAllNumbers ¶ added in v1.0.4
func IsRuneNumber ¶ added in v1.0.4
func ParseConfig ¶ added in v1.0.7
func SplitSlice ¶
func SplitSliceNWhite ¶ added in v1.0.4
func SplitWhite ¶ added in v1.0.4
SplitWhite splits the string with the given separator and will remove the white spaces slices from the results
func ToStrSlice ¶
Types ¶
type QString ¶ added in v1.0.4
type QString interface {
Length() int
IsEmpty() bool
GetValue() string
GetIndexV(int) rune
IsEqual(QString) bool
Split(...QString) []QString
SplitN(int, ...QString) []QString
SplitFirst(qs ...QString) []QString
SplitStr(...string) []QString
SplitStrN(int, ...string) []QString
SplitStrFirst(...string) []QString
Contains(...QString) bool
ContainsStr(...string) bool
ContainsAll(...QString) bool
ContainsStrAll(...string) bool
TrimPrefix(...QString) QString
TrimPrefixStr(...string) QString
TrimSuffix(...QString) QString
TrimSuffixStr(...string) QString
Trim(qs ...QString) QString
TrimStr(...string) QString
Replace(qs, newS QString) QString
ReplaceStr(qs, newS string) QString
LockSpecial()
UnlockSpecial()
ToBool() bool
}
type StrongString ¶
type StrongString struct {
// contains filtered or unexported fields
}
the StrongString used in the program for additional usage.
func Sb ¶
func Sb(b []byte) StrongString
Sb will generate a new StrongString with the specified non-encoded bytes value.
func Ss ¶
func Ss(s string) StrongString
Ss will generate a new StrongString with the specified non-encoded string value.
func SsPtr ¶
func SsPtr(s string) *StrongString
SS will generate a new StrongString with the specified non-encoded string value.
func (*StrongString) Contains ¶
func (s *StrongString) Contains(qs ...QString) bool
func (*StrongString) ContainsAll ¶
func (s *StrongString) ContainsAll(qs ...QString) bool
func (*StrongString) ContainsStr ¶
func (s *StrongString) ContainsStr(str ...string) bool
func (*StrongString) ContainsStrAll ¶
func (s *StrongString) ContainsStrAll(str ...string) bool
func (*StrongString) GetIndexV ¶
func (s *StrongString) GetIndexV(index int) rune
GetIndexV method will give you the rune in index. if the passed-by `index` is out of range, it will return zero index of the value.
func (*StrongString) GetValue ¶
func (s *StrongString) GetValue() string
GetValue will give you the real value of this StrongString.
func (*StrongString) HasPrefix ¶
func (s *StrongString) HasPrefix(values ...string) bool
HasPrefix will check if at least there is one prefix is presents in this StrongString or not. the StrongString should starts with at least one of these prefixes.
func (*StrongString) HasPrefixes ¶
func (s *StrongString) HasPrefixes(values ...string) bool
HasPrefixes will check if all of the prefixes are present in this StrongString or not. the StrongString should starts with all of these suffixes. usage of this method is not recommended, since you can use HasSuffix method with only one string (the longest string). this way you will just use too much cpu resources.
func (*StrongString) HasRunePrefix ¶ added in v1.0.6
func (s *StrongString) HasRunePrefix(values ...rune) bool
HasRunePrefix will check if at least there is one prefix is presents in this StrongString or not. the StrongString should starts with at least one of these prefixes.
func (*StrongString) HasRunePrefixes ¶ added in v1.0.6
func (s *StrongString) HasRunePrefixes(values ...rune) bool
HasRunePrefixes will check if all of the prefixes are present in this StrongString or not. the StrongString should starts with all of these suffixes. usage of this method is not recommended, since you can use HasSuffix method with only one string (the longest string). this way you will just use too much cpu resources.
func (*StrongString) HasSuffix ¶
func (s *StrongString) HasSuffix(values ...string) bool
HasSuffix will check if at least there is one suffix is presents in this StrongString not. the StrongString should ends with at least one of these suffixes.
func (*StrongString) HasSuffixes ¶
func (s *StrongString) HasSuffixes(values ...string) bool
HasSuffixes will check if all of the suffixes are present in this StrongString or not. the StrongString should ends with all of these suffixes. usage of this method is not recommended, since you can use HasSuffix method with only one string (the longest string). this way you will just use too much cpu resources.
func (*StrongString) IsEmpty ¶
func (s *StrongString) IsEmpty() bool
isEmpty will check if this StrongString is empty or not.
func (*StrongString) IsEqual ¶
func (s *StrongString) IsEqual(q QString) bool
isEqual will check if the passed-by-value in the arg is equal to this StrongString or not.
func (*StrongString) Length ¶
func (s *StrongString) Length() int
length method, will give you the length-as-int of this StrongString.
func (*StrongString) LockSpecial ¶
func (s *StrongString) LockSpecial()
LockSpecial will lock all the defined special characters. This way, you don't actually have to be worry about some normal mistakes in spliting strings, cut them out, check them. join them, etc... WARNING: this method is so dangerous, it's really dangerous. we can't say that it's unsafe actually, but still it's really dangerous, so if you don't know what the fuck are you doing, then please don't use this method. this method will not return you a new value, it will effect the current value. please consider using it carefully.
func (*StrongString) Replace ¶
func (s *StrongString) Replace(qs, newS QString) QString
func (*StrongString) ReplaceStr ¶
func (s *StrongString) ReplaceStr(qs, newS string) QString
func (*StrongString) Split ¶
func (s *StrongString) Split(qs ...QString) []QString
func (*StrongString) SplitFirst ¶
func (s *StrongString) SplitFirst(qs ...QString) []QString
func (*StrongString) SplitStr ¶
func (s *StrongString) SplitStr(qs ...string) []QString
func (*StrongString) SplitStrFirst ¶
func (s *StrongString) SplitStrFirst(qs ...string) []QString
func (*StrongString) ToBool ¶ added in v1.0.5
func (s *StrongString) ToBool() bool
func (*StrongString) ToQString ¶
func (s *StrongString) ToQString() QString
func (*StrongString) Trim ¶
func (s *StrongString) Trim(qs ...QString) QString
func (*StrongString) TrimPrefix ¶
func (s *StrongString) TrimPrefix(qs ...QString) QString
func (*StrongString) TrimPrefixStr ¶
func (s *StrongString) TrimPrefixStr(qs ...string) QString
func (*StrongString) TrimStr ¶
func (s *StrongString) TrimStr(qs ...string) QString
func (*StrongString) TrimSuffix ¶
func (s *StrongString) TrimSuffix(qs ...QString) QString
func (*StrongString) TrimSuffixStr ¶
func (s *StrongString) TrimSuffixStr(qs ...string) QString
func (*StrongString) UnlockSpecial ¶
func (s *StrongString) UnlockSpecial()
UnlockSpecial will unlock all the defiend special characters. it will return them to their normal form.