Documentation ¶
Index ¶
- Constants
- func AppendUnique[T comparable](slice []T, value ...T) []T
- func AreEqual(s1, s2 *string) bool
- func Clone[T any](value *T) *T
- func FixSplit(myStrings []string) []string
- func FixSplitWhite(myStrings []string) []string
- func GetPrettyTimeDuration(d time.Duration, shorten bool) string
- func IsAllLower(value string) bool
- func IsAllNumber(str string) bool
- func IsAllNumbers(str ...string) bool
- func IsAllUpper(value string) bool
- func IsEmpty(s *string) bool
- func IsMixedCase(value string) bool
- func IsRuneNumber(r rune) bool
- func MakeSureNum(i, count int) string
- func MakeSureNumCustom(i, count int, holder string) string
- func ParseConfig(value interface{}, filename string) error
- func RecoverPanic()
- func Split(s string, separator ...string) []string
- func SplitN(s string, n int, separators ...string) []string
- func SplitSlice(s string, separators []string) []string
- func SplitSliceN(s string, separators []string, n int) []string
- func SplitSliceNWhite(s string, separators []string, n int) []string
- func SplitWhite(s string, separator ...string) []string
- func Title(value string) string
- func ToArray(strs ...string) []string
- func ToBase10[T rangeValues.Integer](value T) string
- func ToBase16[T rangeValues.Integer](value T) string
- func ToBase18[T rangeValues.Integer](value T) string
- func ToBase20[T rangeValues.Integer](value T) string
- func ToBase28[T rangeValues.Integer](value T) string
- func ToBase30[T rangeValues.Integer](value T) string
- func ToBase32[T rangeValues.Integer](value T) string
- func ToBool(str string) bool
- func ToInt16(value string) int16
- func ToInt32(value string) int32
- func ToInt64(value string) int64
- func ToInt8(value string) int8
- func ToInteger[T rangeValues.Integer](value string) T
- func ToStrSlice(qs []QString) []string
- func ToValidIntegerString(value string) string
- func YesOrNo(v bool) string
- type AdvancedMap
- func (s *AdvancedMap[TKey, TValue]) Add(key TKey, value *TValue)
- func (s *AdvancedMap[TKey, TValue]) AddList(keyGetter func(*TValue) TKey, elements ...TValue)
- func (s *AdvancedMap[TKey, TValue]) AddPointerList(keyGetter func(*TValue) TKey, elements ...*TValue)
- func (s *AdvancedMap[TKey, TValue]) Clear()
- func (s *AdvancedMap[TKey, TValue]) Delete(key TKey)
- func (s *AdvancedMap[TKey, TValue]) Exists(key TKey) bool
- func (s *AdvancedMap[TKey, TValue]) ForEach(fn func(TKey, *TValue) bool)
- func (s *AdvancedMap[TKey, TValue]) Get(key TKey) *TValue
- func (s *AdvancedMap[TKey, TValue]) GetRandom() *TValue
- func (s *AdvancedMap[TKey, TValue]) GetRandomKey() (key TKey, ok bool)
- func (s *AdvancedMap[TKey, TValue]) GetRandomValue() TValue
- func (s *AdvancedMap[TKey, TValue]) GetValue(key TKey) TValue
- func (s *AdvancedMap[TKey, TValue]) IsEmpty() bool
- func (s *AdvancedMap[TKey, TValue]) IsThreadSafe() bool
- func (s *AdvancedMap[TKey, TValue]) IsValid() bool
- func (s *AdvancedMap[TKey, TValue]) Length() int
- func (s *AdvancedMap[TKey, TValue]) Set(key TKey, value any)
- func (s *AdvancedMap[TKey, TValue]) SetDefault(value TValue)
- func (s *AdvancedMap[TKey, TValue]) ToArray() []TValue
- func (s *AdvancedMap[TKey, TValue]) ToList() GenericList[*TValue]
- func (s *AdvancedMap[TKey, TValue]) ToNormalMap() map[TKey]TValue
- func (s *AdvancedMap[TKey, TValue]) ToPointerArray() []*TValue
- type BasicObject
- type BitsBlocks
- type BytesObject
- type EndpointError
- type EndpointResponse
- type ExecuteCommandResult
- func RunCommand(command string) *ExecuteCommandResult
- func RunCommandAsync(command string) *ExecuteCommandResult
- func RunCommandAsyncWithChan(command string, finishedChan chan bool) *ExecuteCommandResult
- func RunPowerShell(command string) *ExecuteCommandResult
- func RunPowerShellAsyncWithChan(command string, finishedChan chan bool) *ExecuteCommandResult
- type ExpiringValue
- type GenericList
- type Int16Container
- type Int32Container
- type Int64Container
- type Int64UniqueIdContainer
- type Int8Container
- type IntegerRepresent
- type ListW
- func (l *ListW[T]) Add(elements ...T)
- func (l *ListW[T]) Append(elements ...T)
- func (l *ListW[T]) AsArray() []T
- func (l *ListW[T]) Change(index int, element T)
- func (l *ListW[T]) Clear()
- func (l *ListW[T]) Contains(element T) bool
- func (l *ListW[T]) ContainsAll(elements ...T) bool
- func (l *ListW[T]) ContainsOne(elements ...T) bool
- func (l *ListW[T]) Count(element T) int
- func (l *ListW[T]) Counts(element ...T) int
- func (l *ListW[T]) Exists(element T) bool
- func (l *ListW[T]) Find(element T) int
- func (l *ListW[T]) Get(index int) T
- func (l *ListW[T]) IsEmpty() bool
- func (l *ListW[T]) IsThreadSafe() bool
- func (l *ListW[T]) IsValid() bool
- func (l *ListW[T]) Length() int
- func (l *ListW[T]) Remove(element T)
- func (l *ListW[T]) RemoveAll(element ...T)
- func (l *ListW[T]) RemoveAt(index int)
- func (l *ListW[T]) RemoveOnce(element T)
- func (l *ListW[T]) ToArray() []T
- type MetaDataProvider
- type NumIdGenerator
- type QString
- type RangeFloat64
- type RangeInt
- type RangeInt32
- type RangeInt64
- type SafeEMap
- func (s *SafeEMap[TKey, TValue]) Add(key TKey, value *TValue)
- func (s *SafeEMap[TKey, TValue]) AddList(keyGetter func(*TValue) TKey, elements ...TValue)
- func (s *SafeEMap[TKey, TValue]) AddPointerList(keyGetter func(*TValue) TKey, elements ...*TValue)
- func (s *SafeEMap[TKey, TValue]) Clear()
- func (s *SafeEMap[TKey, TValue]) Delete(key TKey)
- func (s *SafeEMap[TKey, TValue]) Disable()
- func (s *SafeEMap[TKey, TValue]) DisableChecking()
- func (s *SafeEMap[TKey, TValue]) DoCheck()
- func (s *SafeEMap[TKey, TValue]) Enable()
- func (s *SafeEMap[TKey, TValue]) EnableChecking()
- func (s *SafeEMap[TKey, TValue]) Exists(key TKey) bool
- func (s *SafeEMap[TKey, TValue]) ForEach(fn func(TKey, *TValue) bool)
- func (s *SafeEMap[TKey, TValue]) Get(key TKey) *TValue
- func (s *SafeEMap[TKey, TValue]) GetRandom() *TValue
- func (s *SafeEMap[TKey, TValue]) GetRandomKey() (key TKey, ok bool)
- func (s *SafeEMap[TKey, TValue]) GetRandomValue() TValue
- func (s *SafeEMap[TKey, TValue]) GetValue(key TKey) TValue
- func (s *SafeEMap[TKey, TValue]) HasValidTimings() bool
- func (s *SafeEMap[TKey, TValue]) IsChecking() bool
- func (s *SafeEMap[TKey, TValue]) IsDisabled() bool
- func (s *SafeEMap[TKey, TValue]) IsEmpty() bool
- func (s *SafeEMap[TKey, TValue]) IsThreadSafe() bool
- func (s *SafeEMap[TKey, TValue]) IsValid() bool
- func (s *SafeEMap[TKey, TValue]) Length() int
- func (s *SafeEMap[TKey, TValue]) Set(key TKey, value any)
- func (s *SafeEMap[TKey, TValue]) SetDefault(value TValue)
- func (s *SafeEMap[TKey, TValue]) SetExpiration(duration time.Duration)
- func (s *SafeEMap[TKey, TValue]) SetInterval(duration time.Duration)
- func (s *SafeEMap[TKey, TValue]) SetOnExpired(event func(key TKey, value TValue))
- func (s *SafeEMap[TKey, TValue]) ToArray() []TValue
- func (s *SafeEMap[TKey, TValue]) ToList() GenericList[*TValue]
- func (s *SafeEMap[TKey, TValue]) ToNormalMap() map[TKey]TValue
- func (s *SafeEMap[TKey, TValue]) ToPointerArray() []*TValue
- type SafeMap
- func (s *SafeMap[TKey, TValue]) Add(key TKey, value *TValue)
- func (s *SafeMap[TKey, TValue]) AddList(keyGetter func(*TValue) TKey, elements ...TValue)
- func (s *SafeMap[TKey, TValue]) AddPointerList(keyGetter func(*TValue) TKey, elements ...*TValue)
- func (s *SafeMap[TKey, TValue]) Clear()
- func (s *SafeMap[TKey, TValue]) Delete(key TKey)
- func (s *SafeMap[TKey, TValue]) Disable()
- func (s *SafeMap[TKey, TValue]) Enable()
- func (s *SafeMap[TKey, TValue]) Exists(key TKey) bool
- func (s *SafeMap[TKey, TValue]) ForEach(fn func(TKey, *TValue) bool)
- func (s *SafeMap[TKey, TValue]) Get(key TKey) *TValue
- func (s *SafeMap[TKey, TValue]) GetValue(key TKey) TValue
- func (s *SafeMap[TKey, TValue]) IsDisabled() bool
- func (s *SafeMap[TKey, TValue]) IsEmpty() bool
- func (s *SafeMap[TKey, TValue]) IsThreadSafe() bool
- func (s *SafeMap[TKey, TValue]) IsValid() bool
- func (s *SafeMap[TKey, TValue]) Length() int
- func (s *SafeMap[TKey, TValue]) Set(key TKey, value any)
- func (s *SafeMap[TKey, TValue]) SetDefault(value TValue)
- func (s *SafeMap[TKey, TValue]) ToArray() []TValue
- func (s *SafeMap[TKey, TValue]) ToList() GenericList[*TValue]
- func (s *SafeMap[TKey, TValue]) ToNormalMap() map[TKey]TValue
- func (s *SafeMap[TKey, TValue]) ToPointerArray() []*TValue
- type Serializer
- type SignatureContainer
- type StringUniqueIdContainer
- 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()
- type UInt16Container
- type UInt32Container
- type UInt64Container
- type UInt8Container
- type UniqueIdContainer
- type Validator
Constants ¶
const ( COMMAND_PREFIX1 = "!" COMMAND_PREFIX2 = "/" SUDO_PREFIX1 = ">" FLAG_PREFIX = "--" )
the prefix values for commands.
const ( JA_Str = "❞\u200d;" // start character (") for string in japanese. JA_Equality = "=\u200d;" // equal character (=) in japanese. JA_Ddot = ":\u200d;" // ddot character (:) in japanese. JA_Coma = "、\u200d;" // coma 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_Coma = `\,` 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 underscore : _ 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 = ";" Coma = "," 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 = internal.OrRegexp // the or string sign: "|" )
router config values
const ( LineChar = '-' // line : '-' EqualChar = '=' // equal: '=' SpaceChar = ' ' // space: ' ' DPointChar = ':' // double point: ':' BracketOpenChar = '[' // bracket open: '[' BracketCloseChar = ']' // bracket close: ']' ComaChar = ',' // coma: ',' )
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 = "\\:" )
const (
LIST_INDEX_NOTFOUND = -1
)
Variables ¶
This section is empty.
Functions ¶
func AppendUnique ¶
func AppendUnique[T comparable](slice []T, value ...T) []T
AppendUnique appends the given value to the given slice if it's not already there. WARNING: Performance is not good for large slices.
func Clone ¶
func Clone[T any](value *T) *T
Clone function will make an exact copy of the given value. It will return nil if the given value is nil, so it's guaranteed to execute without panic. Usage of this function is up to the users, but it's recommended to not use it on large structures, since it will allocate too much memory.
func FixSplit ¶
FixSplit will fix the bullshit bug in the Split function (which is not ignoring the spaces between strings).
func FixSplitWhite ¶
FixSplit will fix the bullshit bug in the Split function (which is not ignoring the spaces between strings).
func IsAllLower ¶
func IsAllNumber ¶
func IsAllNumbers ¶
func IsAllUpper ¶
func IsMixedCase ¶
func IsRuneNumber ¶
func MakeSureNum ¶
MakeSureNum will make sure that when you convert `i` to string, its length be the exact same as `count`. it will append 0 to the left side of the number to do so. for example: MakeSureNum(5, 8) will return "00000005"
func MakeSureNumCustom ¶
MakeSureNumCustom will make sure that when you convert `i` to string, its length be the exact same as `count`. it will append 0 to the left side of the number to do so. for example: MakeSureNum(5, 8) will return "00000005"
func ParseConfig ¶
func RecoverPanic ¶
func RecoverPanic()
func SplitSlice ¶
func SplitWhite ¶
SplitWhite splits the string with the given separator and will remove the white spaces slices from the results
func ToBase10 ¶
func ToBase10[T rangeValues.Integer](value T) string
func ToBase16 ¶
func ToBase16[T rangeValues.Integer](value T) string
func ToBase18 ¶
func ToBase18[T rangeValues.Integer](value T) string
func ToBase20 ¶
func ToBase20[T rangeValues.Integer](value T) string
func ToBase28 ¶
func ToBase28[T rangeValues.Integer](value T) string
func ToBase30 ¶
func ToBase30[T rangeValues.Integer](value T) string
func ToBase32 ¶
func ToBase32[T rangeValues.Integer](value T) string
func ToInteger ¶
func ToInteger[T rangeValues.Integer](value string) T
ToInteger converts a specified string value to integer.
func ToStrSlice ¶
func ToValidIntegerString ¶
Types ¶
type AdvancedMap ¶
type AdvancedMap[TKey comparable, TValue any] struct { // contains filtered or unexported fields }
AdvancedMap is a safe map of type TIndex to pointers of type TValue with extra advanced features that you can't find in safe-map types. obviously, because of its extra features, it's slightly slower than other normal safe-map types. this map is completely thread safe and is using internal lock when getting and setting variables.
func NewAdvancedMap ¶
func NewAdvancedMap[TKey comparable, TValue any]() *AdvancedMap[TKey, TValue]
func (*AdvancedMap[TKey, TValue]) Add ¶
func (s *AdvancedMap[TKey, TValue]) Add(key TKey, value *TValue)
func (*AdvancedMap[TKey, TValue]) AddList ¶
func (s *AdvancedMap[TKey, TValue]) AddList(keyGetter func(*TValue) TKey, elements ...TValue)
func (*AdvancedMap[TKey, TValue]) AddPointerList ¶
func (s *AdvancedMap[TKey, TValue]) AddPointerList(keyGetter func(*TValue) TKey, elements ...*TValue)
func (*AdvancedMap[TKey, TValue]) Clear ¶
func (s *AdvancedMap[TKey, TValue]) Clear()
Clear will clear the whole map.
func (*AdvancedMap[TKey, TValue]) Delete ¶
func (s *AdvancedMap[TKey, TValue]) Delete(key TKey)
func (*AdvancedMap[TKey, TValue]) Exists ¶
func (s *AdvancedMap[TKey, TValue]) Exists(key TKey) bool
func (*AdvancedMap[TKey, TValue]) ForEach ¶
func (s *AdvancedMap[TKey, TValue]) ForEach(fn func(TKey, *TValue) bool)
func (*AdvancedMap[TKey, TValue]) Get ¶
func (s *AdvancedMap[TKey, TValue]) Get(key TKey) *TValue
func (*AdvancedMap[TKey, TValue]) GetRandom ¶
func (s *AdvancedMap[TKey, TValue]) GetRandom() *TValue
func (*AdvancedMap[TKey, TValue]) GetRandomKey ¶
func (s *AdvancedMap[TKey, TValue]) GetRandomKey() (key TKey, ok bool)
func (*AdvancedMap[TKey, TValue]) GetRandomValue ¶
func (s *AdvancedMap[TKey, TValue]) GetRandomValue() TValue
func (*AdvancedMap[TKey, TValue]) GetValue ¶
func (s *AdvancedMap[TKey, TValue]) GetValue(key TKey) TValue
func (*AdvancedMap[TKey, TValue]) IsEmpty ¶
func (s *AdvancedMap[TKey, TValue]) IsEmpty() bool
func (*AdvancedMap[TKey, TValue]) IsThreadSafe ¶
func (s *AdvancedMap[TKey, TValue]) IsThreadSafe() bool
func (*AdvancedMap[TKey, TValue]) IsValid ¶
func (s *AdvancedMap[TKey, TValue]) IsValid() bool
func (*AdvancedMap[TKey, TValue]) Length ¶
func (s *AdvancedMap[TKey, TValue]) Length() int
func (*AdvancedMap[TKey, TValue]) Set ¶
func (s *AdvancedMap[TKey, TValue]) Set(key TKey, value any)
Set function sets the key of type TKey in this safe map to the value. the value should be of type TValue or *TValue, otherwise this function won't do anything at all.
func (*AdvancedMap[TKey, TValue]) SetDefault ¶
func (s *AdvancedMap[TKey, TValue]) SetDefault(value TValue)
func (*AdvancedMap[TKey, TValue]) ToArray ¶
func (s *AdvancedMap[TKey, TValue]) ToArray() []TValue
func (*AdvancedMap[TKey, TValue]) ToList ¶
func (s *AdvancedMap[TKey, TValue]) ToList() GenericList[*TValue]
func (*AdvancedMap[TKey, TValue]) ToNormalMap ¶
func (s *AdvancedMap[TKey, TValue]) ToNormalMap() map[TKey]TValue
func (*AdvancedMap[TKey, TValue]) ToPointerArray ¶
func (s *AdvancedMap[TKey, TValue]) ToPointerArray() []*TValue
type BasicObject ¶
type BitsBlocks ¶
type BitsBlocks interface {
GetBitsSize() int
}
type BytesObject ¶
type EndpointError ¶
type EndpointError struct { ErrorCode int `json:"code"` ErrorType int `json:"error_type"` Message string `json:"message"` Origin string `json:"origin"` Date string `json:"date"` }
EndpointError is the generalized form of an error from a HTTP API. this type should be used as a pointer in EndpointResponse.
func (*EndpointError) Error ¶
func (e *EndpointError) Error() string
type EndpointResponse ¶
type EndpointResponse[T any] struct { Success bool `json:"success"` Result *T `json:"result"` Error *EndpointError `json:"error"` }
EndpointResponse is the generalized form of a response from a HTTP API.
T field is already a pointer in this struct, please avoid passing a pointer
type, to prevent from `Result` field being a pointer to a pointer.
type ExecuteCommandResult ¶
type ExecuteCommandResult = shellUtils.ExecuteCommandResult
func RunCommand ¶
func RunCommand(command string) *ExecuteCommandResult
func RunCommandAsync ¶
func RunCommandAsync(command string) *ExecuteCommandResult
func RunCommandAsyncWithChan ¶
func RunCommandAsyncWithChan(command string, finishedChan chan bool) *ExecuteCommandResult
RunCommandAsyncWithChan runs the given command in another goroutine and returns back from the function immediately. It will sends `true` to `finishedChan` the moment it's done executing the command.
func RunPowerShell ¶
func RunPowerShell(command string) *ExecuteCommandResult
func RunPowerShellAsyncWithChan ¶
func RunPowerShellAsyncWithChan(command string, finishedChan chan bool) *ExecuteCommandResult
RunCommandAsyncWithChan runs the given command in another goroutine and returns back from the function immediately. It will sends `true` to `finishedChan` the moment it's done executing the command.
type ExpiringValue ¶
type ExpiringValue[T any] struct { // contains filtered or unexported fields }
func NewEValue ¶
func NewEValue[T any](value T) *ExpiringValue[T]
func (*ExpiringValue[T]) GetTime ¶
func (e *ExpiringValue[T]) GetTime() time.Time
func (*ExpiringValue[T]) GetValue ¶
func (e *ExpiringValue[T]) GetValue() T
func (*ExpiringValue[T]) IsExpired ¶
func (e *ExpiringValue[T]) IsExpired(duration time.Duration) bool
func (*ExpiringValue[T]) Reset ¶
func (e *ExpiringValue[T]) Reset()
func (*ExpiringValue[T]) SetTime ¶
func (e *ExpiringValue[T]) SetTime(t time.Time)
func (*ExpiringValue[T]) SetValue ¶
func (e *ExpiringValue[T]) SetValue(value T)
type GenericList ¶
type GenericList[T comparable] interface { BasicObject Validator Find(element T) int Count(element T) int Counts(element ...T) int Contains(element T) bool ContainsAll(elements ...T) bool ContainsOne(elements ...T) bool Change(index int, element T) Exists(element T) bool Append(elements ...T) Add(elements ...T) RemoveAt(index int) RemoveOnce(element T) RemoveAll(element ...T) Remove(element T) AsArray() []T ToArray() []T Clear() Get(index int) T }
func GetEmptyList ¶
func GetEmptyList[T comparable]() GenericList[T]
func GetListFromArray ¶
func GetListFromArray[T comparable](array []T) GenericList[T]
type Int16Container ¶
type Int16Container = rangeValues.IntContainer[int16]
type Int32Container ¶
type Int32Container = rangeValues.IntContainer[int32]
type Int64Container ¶
type Int64Container = rangeValues.IntContainer[int64]
type Int64UniqueIdContainer ¶
type Int64UniqueIdContainer = UniqueIdContainer[int64]
type Int8Container ¶
type Int8Container = rangeValues.IntContainer[int8]
type IntegerRepresent ¶
type ListW ¶
type ListW[T comparable] struct { // contains filtered or unexported fields }
func (*ListW[T]) AsArray ¶
func (l *ListW[T]) AsArray() []T
AsArray returns a copy of the value of this list as an array. please do notice that if you make changes to the underlying values of that array, change won't be applied to the list.
func (*ListW[T]) ContainsAll ¶
func (*ListW[T]) ContainsOne ¶
func (*ListW[T]) IsThreadSafe ¶
func (*ListW[T]) RemoveOnce ¶
func (l *ListW[T]) RemoveOnce(element T)
type MetaDataProvider ¶
type MetaDataProvider interface { Get(key string) (string, error) GetInt(key string) (int, error) GetInt8(key string) (int8, error) GetInt16(key string) (int16, error) GetInt32(key string) (int32, error) GetInt64(key string) (int64, error) GetUInt(key string) (uint, error) GetUInt8(key string) (uint8, error) GetUInt16(key string) (uint16, error) GetUInt32(key string) (uint32, error) GetUInt64(key string) (uint64, error) GetBool(key string) (bool, error) GetNoErr(key string) string GetIntNoErr(key string) int GetInt8NoErr(key string) int8 GetInt16NoErr(key string) int16 GetInt32NoErr(key string) int32 GetInt64NoErr(key string) int64 GetUIntNoErr(key string) uint GetUInt8NoErr(key string) uint8 GetUInt16NoErr(key string) uint16 GetUInt32NoErr(key string) uint32 GetUInt64NoErr(key string) uint64 GetBoolNoErr(key string) bool Set(key, value string) SetInt(key string, value int) SetInt8(key string, value int8) SetInt16(key string, value int16) SetInt32(key string, value int32) SetInt64(key string, value int64) SetUInt(key string, value uint) SetUInt8(key string, value uint8) SetUInt16(key string, value uint16) SetUInt32(key string, value uint32) SetUInt64(key string, value uint64) SetBool(key string, value bool) }
MetaDataProvider interface provides useful methods for getting/setting metadata for a data structure.
type NumIdGenerator ¶
type NumIdGenerator[T rangeValues.Integer] struct { // contains filtered or unexported fields }
func NewNumIdGenerator ¶
func NewNumIdGenerator[T rangeValues.Integer]() *NumIdGenerator[T]
func (*NumIdGenerator[T]) Next ¶
func (n *NumIdGenerator[T]) Next() T
Next method returns the next id and will move the current cursor to the next id and will return that. current integer won't be available after this method call.
func (*NumIdGenerator[T]) Reset ¶
func (n *NumIdGenerator[T]) Reset()
Reset method will set the current value to 0.
func (*NumIdGenerator[T]) SafeSet ¶
func (n *NumIdGenerator[T]) SafeSet(current T)
SafeSet method will set the current value to the given value if and only if the passed value is more than current value of the generator. please do notice that with calling n.Next() method, you will get the next id and not the current value.
func (*NumIdGenerator[T]) Set ¶
func (n *NumIdGenerator[T]) Set(current T)
Set method will set the current value to the given value. please do notice that with calling n.Next() method, you will get the next id and not the current value.
type QString ¶
type QString interface { BasicObject 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 RangeFloat64 ¶
type RangeFloat64 = rangeValues.RangeFloat64
type RangeInt ¶
type RangeInt = rangeValues.IntegerRange[int]
type RangeInt32 ¶
type RangeInt32 = rangeValues.IntegerRange[int32]
type RangeInt64 ¶
type RangeInt64 = rangeValues.IntegerRange[int64]
type SafeEMap ¶
type SafeEMap[TKey comparable, TValue any] struct { // contains filtered or unexported fields }
SafeEMap is a safe map of type TIndex to pointers of type TValue. this map is completely thread safe and is using internal lock when getting and setting variables. the difference of SafeEMap and SafeMap is that SafeEMap is using a checker loop for removing the expired values from itself.
func NewSafeEMap ¶
func NewSafeEMap[TKey comparable, TValue any]() *SafeEMap[TKey, TValue]
func (*SafeEMap[TKey, TValue]) AddList ¶
func (s *SafeEMap[TKey, TValue]) AddList(keyGetter func(*TValue) TKey, elements ...TValue)
func (*SafeEMap[TKey, TValue]) AddPointerList ¶
func (s *SafeEMap[TKey, TValue]) AddPointerList(keyGetter func(*TValue) TKey, elements ...*TValue)
func (*SafeEMap[TKey, TValue]) Clear ¶
func (s *SafeEMap[TKey, TValue]) Clear()
Clear will clear the whole map.
func (*SafeEMap[TKey, TValue]) Disable ¶
func (s *SafeEMap[TKey, TValue]) Disable()
Disable will disable this map, meaning that it won't be able to add new values, but will still be able to delete/read values.
func (*SafeEMap[TKey, TValue]) DisableChecking ¶
func (s *SafeEMap[TKey, TValue]) DisableChecking()
func (*SafeEMap[TKey, TValue]) DoCheck ¶
func (s *SafeEMap[TKey, TValue]) DoCheck()
DoCheck iterates over the map and checks for expired variables and removes them. if the `onExpired` member of the map is set, it will call them.
func (*SafeEMap[TKey, TValue]) Enable ¶
func (s *SafeEMap[TKey, TValue]) Enable()
Enable will enable this map, meaning that it will be able to add new values.
func (*SafeEMap[TKey, TValue]) EnableChecking ¶
func (s *SafeEMap[TKey, TValue]) EnableChecking()
func (*SafeEMap[TKey, TValue]) GetRandomKey ¶
func (*SafeEMap[TKey, TValue]) GetRandomValue ¶
func (s *SafeEMap[TKey, TValue]) GetRandomValue() TValue
func (*SafeEMap[TKey, TValue]) GetValue ¶
func (s *SafeEMap[TKey, TValue]) GetValue(key TKey) TValue
func (*SafeEMap[TKey, TValue]) HasValidTimings ¶
func (*SafeEMap[TKey, TValue]) IsChecking ¶
func (*SafeEMap[TKey, TValue]) IsDisabled ¶
IsDisabled returns true if this map is disabled. Disabled maps won't be able to add new values, but will still be able to delete/read values.
func (*SafeEMap[TKey, TValue]) IsThreadSafe ¶
func (*SafeEMap[TKey, TValue]) Set ¶
Set function sets the key of type TKey in this safe map to the value. the value should be of type TValue or *TValue, otherwise this function won't do anything at all.
func (*SafeEMap[TKey, TValue]) SetDefault ¶
func (s *SafeEMap[TKey, TValue]) SetDefault(value TValue)
func (*SafeEMap[TKey, TValue]) SetExpiration ¶
func (*SafeEMap[TKey, TValue]) SetInterval ¶
func (*SafeEMap[TKey, TValue]) SetOnExpired ¶
func (s *SafeEMap[TKey, TValue]) SetOnExpired(event func(key TKey, value TValue))
func (*SafeEMap[TKey, TValue]) ToList ¶
func (s *SafeEMap[TKey, TValue]) ToList() GenericList[*TValue]
func (*SafeEMap[TKey, TValue]) ToNormalMap ¶
func (s *SafeEMap[TKey, TValue]) ToNormalMap() map[TKey]TValue
func (*SafeEMap[TKey, TValue]) ToPointerArray ¶
func (s *SafeEMap[TKey, TValue]) ToPointerArray() []*TValue
type SafeMap ¶
type SafeMap[TKey comparable, TValue any] struct { // contains filtered or unexported fields }
SafeMap is a safe map of type TIndex to pointers of type TValue. this map is completely thread safe and is using internal lock when getting and setting variables.
func NewSafeMap ¶
func NewSafeMap[TKey comparable, TValue any]() *SafeMap[TKey, TValue]
func (*SafeMap[TKey, TValue]) AddList ¶
func (s *SafeMap[TKey, TValue]) AddList(keyGetter func(*TValue) TKey, elements ...TValue)
func (*SafeMap[TKey, TValue]) AddPointerList ¶
func (s *SafeMap[TKey, TValue]) AddPointerList(keyGetter func(*TValue) TKey, elements ...*TValue)
func (*SafeMap[TKey, TValue]) Clear ¶
func (s *SafeMap[TKey, TValue]) Clear()
Clear will clear the whole map.
func (*SafeMap[TKey, TValue]) Disable ¶
func (s *SafeMap[TKey, TValue]) Disable()
Disable will disable this map, meaning that it won't be able to add new values, but will still be able to delete/read values.
func (*SafeMap[TKey, TValue]) Enable ¶
func (s *SafeMap[TKey, TValue]) Enable()
Enable will enable this map, meaning that it will be able to add new values.
func (*SafeMap[TKey, TValue]) IsDisabled ¶
IsDisabled returns true if this map is disabled. Disabled maps won't be able to add new values, but will still be able to delete/read values.
func (*SafeMap[TKey, TValue]) IsThreadSafe ¶
func (*SafeMap[TKey, TValue]) Set ¶
Set function sets the key of type TKey in this safe map to the value. the value should be of type TValue or *TValue, otherwise this function won't do anything at all.
func (*SafeMap[TKey, TValue]) SetDefault ¶
func (s *SafeMap[TKey, TValue]) SetDefault(value TValue)
func (*SafeMap[TKey, TValue]) ToList ¶
func (s *SafeMap[TKey, TValue]) ToList() GenericList[*TValue]
func (*SafeMap[TKey, TValue]) ToNormalMap ¶
func (s *SafeMap[TKey, TValue]) ToNormalMap() map[TKey]TValue
func (*SafeMap[TKey, TValue]) ToPointerArray ¶
func (s *SafeMap[TKey, TValue]) ToPointerArray() []*TValue
type Serializer ¶
type SignatureContainer ¶
type StringUniqueIdContainer ¶
type StringUniqueIdContainer = UniqueIdContainer[string]
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 ¶
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 ¶
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 splitting 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 ¶
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 defined special characters. it will return them to their normal form.
type UInt16Container ¶
type UInt16Container = rangeValues.IntContainer[uint16]
type UInt32Container ¶
type UInt32Container = rangeValues.IntContainer[uint32]
type UInt64Container ¶
type UInt64Container = rangeValues.IntContainer[uint64]
type UInt8Container ¶
type UInt8Container = rangeValues.IntContainer[uint8]
type UniqueIdContainer ¶
type UniqueIdContainer[T comparable] interface { GetUniqueId() T SetAsUniqueId(value T) HasValidUniqueId() bool }