utils

package module
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

README

utils

Rovergulf Engineers common utils repository

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Months = map[time.Month]int{
	time.January:   1,
	time.February:  2,
	time.March:     3,
	time.April:     4,
	time.May:       5,
	time.June:      6,
	time.July:      7,
	time.August:    8,
	time.September: 9,
	time.October:   10,
	time.November:  11,
	time.December:  12,
}

Functions

func AscendingIntSort

func AscendingIntSort(arr intArr) []int

func AscendingStringSort

func AscendingStringSort(arr stringArr) []string

func CheckInt

func CheckInt(old, new int) int

func CheckInt16

func CheckInt16(old, new int16) int16

func CheckInt32

func CheckInt32(old, new int32) int32

func CheckInt64

func CheckInt64(old, new int64) int64

func CheckInt8

func CheckInt8(old, new int8) int8

func CheckJson

func CheckJson(old, new json.RawMessage) (json.RawMessage, error)

func CheckString

func CheckString(old, new string) string

func CheckUint16

func CheckUint16(old, new uint16) uint16

func CheckUint32

func CheckUint32(old, new uint32) uint32

func CheckUint64

func CheckUint64(old, new uint64) uint64

func CheckUint8

func CheckUint8(old, new uint8) uint8

func DescendingIntSort

func DescendingIntSort(arr intArr) []int

func DescendingStringSort

func DescendingStringSort(arr stringArr) []string

func FormatUnixTimestampToPgComparisonValue

func FormatUnixTimestampToPgComparisonValue(timestamp int) string

func GenerateHashFromString

func GenerateHashFromString(str string) string

func GeneratePasswordHash

func GeneratePasswordHash(lg *zap.SugaredLogger, str string, salt string) string

func GetRandomString

func GetRandomString(n int) string

returns random symbol string with specified length = n

func RemoveInt16DuplicatesUnordered

func RemoveInt16DuplicatesUnordered(elements []int16) []int16

func RemoveInt32DuplicatesUnordered

func RemoveInt32DuplicatesUnordered(elements []int32) []int32

func RemoveInt64DuplicatesUnordered

func RemoveInt64DuplicatesUnordered(elements []int64) []int64

func RemoveInt8DuplicatesUnordered

func RemoveInt8DuplicatesUnordered(elements []int8) []int8

func RemoveIntDuplicatesUnordered

func RemoveIntDuplicatesUnordered(elements []int) []int

func RemoveSpecifiedInt16FromSlice

func RemoveSpecifiedInt16FromSlice(elements []int16, toRemove int16, another ...int16) []int16

func RemoveSpecifiedInt32FromSlice

func RemoveSpecifiedInt32FromSlice(elements []int32, toRemove int32, another ...int32) []int32

func RemoveSpecifiedInt64FromSlice

func RemoveSpecifiedInt64FromSlice(elements []int64, toRemove int64, another ...int64) []int64

func RemoveSpecifiedInt8FromSlice

func RemoveSpecifiedInt8FromSlice(elements []int8, toRemove int8, another ...int8) []int8

func RemoveSpecifiedIntFromSlice

func RemoveSpecifiedIntFromSlice(elements []int, toRemove int, another ...int) []int

func RemoveSpecifiedStringFromSlice

func RemoveSpecifiedStringFromSlice(elements []string, toRemove string, another ...string) []string

func RemoveStrDuplicatesUnordered

func RemoveStrDuplicatesUnordered(elements []string) []string

func SendSlackHook

func SendSlackHook(url, channel, username, message string) error

func UnsafeInterfaceByteSize

func UnsafeInterfaceByteSize(res interface{}) float32

func ValidateEmail

func ValidateEmail(email string) bool

func ValidatePhoneNumber

func ValidatePhoneNumber(phone string) bool

func ValidateUserUsername

func ValidateUserUsername(r string) bool

func VerifyBitwiseComparison

func VerifyBitwiseComparison(check uint64, roles ...uint64) bool

Types

type Float32Array

type Float32Array []float32

func (Float32Array) Len

func (s Float32Array) Len() int

func (Float32Array) Less

func (s Float32Array) Less(i, j int) bool

func (Float32Array) Swap

func (s Float32Array) Swap(i, j int)

type Float64Array

type Float64Array []float64

func (Float64Array) Len

func (s Float64Array) Len() int

func (Float64Array) Less

func (s Float64Array) Less(i, j int) bool

func (Float64Array) Swap

func (s Float64Array) Swap(i, j int)

type Int16Array

type Int16Array []int16

func (Int16Array) Len

func (s Int16Array) Len() int

func (Int16Array) Less

func (s Int16Array) Less(i, j int) bool

func (Int16Array) Swap

func (s Int16Array) Swap(i, j int)

type Int32Array

type Int32Array []int32

func (Int32Array) Len

func (s Int32Array) Len() int

func (Int32Array) Less

func (s Int32Array) Less(i, j int) bool

func (Int32Array) Swap

func (s Int32Array) Swap(i, j int)

type Int64Array

type Int64Array []int64

func (Int64Array) Len

func (s Int64Array) Len() int

func (Int64Array) Less

func (s Int64Array) Less(i, j int) bool

func (Int64Array) Swap

func (s Int64Array) Swap(i, j int)

type Int8Array

type Int8Array []int8

func (Int8Array) Len

func (s Int8Array) Len() int

func (Int8Array) Less

func (s Int8Array) Less(i, j int) bool

func (Int8Array) Swap

func (s Int8Array) Swap(i, j int)

type IntArray

type IntArray []int

func (IntArray) Len

func (s IntArray) Len() int

func (IntArray) Less

func (s IntArray) Less(i, j int) bool

func (IntArray) Swap

func (s IntArray) Swap(i, j int)

type PropertyMap

type PropertyMap map[string]interface{}

jsonb

func (*PropertyMap) Scan

func (p *PropertyMap) Scan(source json.RawMessage) error

type StringArray

type StringArray []string

func (StringArray) Len

func (s StringArray) Len() int

func (StringArray) Less

func (s StringArray) Less(i, j int) bool

func (StringArray) Swap

func (s StringArray) Swap(i, j int)

type Uint16Array

type Uint16Array []uint16

func (Uint16Array) Len

func (s Uint16Array) Len() int

func (Uint16Array) Less

func (s Uint16Array) Less(i, j int) bool

func (Uint16Array) Swap

func (s Uint16Array) Swap(i, j int)

type Uint32Array

type Uint32Array []uint32

func (Uint32Array) Len

func (s Uint32Array) Len() int

func (Uint32Array) Less

func (s Uint32Array) Less(i, j int) bool

func (Uint32Array) Swap

func (s Uint32Array) Swap(i, j int)

type Uint64Array

type Uint64Array []uint64

func (Uint64Array) Len

func (s Uint64Array) Len() int

func (Uint64Array) Less

func (s Uint64Array) Less(i, j int) bool

func (Uint64Array) Swap

func (s Uint64Array) Swap(i, j int)

type Uint8Array

type Uint8Array []uint8

func (Uint8Array) Len

func (s Uint8Array) Len() int

func (Uint8Array) Less

func (s Uint8Array) Less(i, j int) bool

func (Uint8Array) Swap

func (s Uint8Array) Swap(i, j int)

type UintArray

type UintArray []uint

func (UintArray) Len

func (s UintArray) Len() int

func (UintArray) Less

func (s UintArray) Less(i, j int) bool

func (UintArray) Swap

func (s UintArray) Swap(i, j int)

Directories

Path Synopsis
datastructures
pq
Package exit provide functionality to handle os signal (SIGINT, SIGKILL, SIGTERM) mainly to handle termination of service
Package exit provide functionality to handle os signal (SIGINT, SIGKILL, SIGTERM) mainly to handle termination of service
mq

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL