helpers

package
v0.0.0-...-2e7d536 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Guard

func Guard(b string) string

Guard edits the given string. example: 'create $#% contact' -> 'create-contact'. @param string @param string return bool

func GuardArray

func GuardArray(b []string) (guardArray []string)

GuardArray edits the given string array. example: 'create $#% contact' -> 'create-contact'. @param []string return []string

func InArray

func InArray(val interface{}, array interface{}) (exists bool)

InArray is the value in the first parameter an element of the array in the second parameter? @param interface{} @param interface{} return bool

func IsArray

func IsArray(value interface{}) bool

IsArray is the given value an array? @param interface{} return bool

func IsInt

func IsInt(value interface{}) bool

IsInt is the given value an integer? @param interface{} return bool

func IsString

func IsString(value interface{}) bool

IsString is the given value an string? @param interface{} return bool

func IsStringArray

func IsStringArray(value interface{}) bool

IsStringArray is the given value an string array? @param interface{} return bool

func IsUInt

func IsUInt(value interface{}) bool

IsUInt is the given value an unsigned integer? @param interface{} return bool

func IsUIntArray

func IsUIntArray(value interface{}) bool

IsUIntArray is the given value an unsigned integer array? @param interface{} return bool

func JoinUintArrays

func JoinUintArrays(array ...[]uint) (j []uint)

JoinUintArrays concatenates the given uint arrays and makes them a single array. @param ...[]uint return []uint

func NextPageCal

func NextPageCal(page int, totalPage int) int

NextPageCal calculate next page according to the page number and total page count. @param int @param int return int

func OffsetCal

func OffsetCal(page int, limit int) int

OffsetCal calculate offset according to page and limit. @param int @param int return int

func Pre

func Pre(x interface{}, y ...interface{})

Pre exit running project. @param interface{} @param ...interface{}

func PrevPageCal

func PrevPageCal(page int) int

PrevPageCal calculate previous page according to page number. @param int return int

func RemoveDuplicateValues

func RemoveDuplicateValues(intSlice []uint) []uint

RemoveDuplicateValues make singular of repeating values in an array. @param []uint return []uint

func TotalPage

func TotalPage(count int64, limit int) int

TotalPage calculate total page according to records count and limit. @param int64 @param int return int

Types

This section is empty.

Jump to

Keyboard shortcuts

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