tools

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureSlashInEnd added in v0.2.0

func EnsureSlashInEnd(url string) string

***************************************************************************************

*
* Function : EnsureSlashInEnd
*
*  Purpose : Ensure slesh is presents in the end of string
*
*    Input : url string - string to check
*
*	 Return : string with slesh in the end

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

***************************************************************************************

*
* Function : GenerateRandomBytes
*
*  Purpose : Generate Random Bytes for reference purpose
*
*    Input : n int - specify size of the buffer
*
*	 Return : []]byte - securely generated random bytes
*			  error - if happened, nil otherwise

func GenerateRandomString

func GenerateRandomString(n int) (string, error)

***************************************************************************************

*
* Function : GenerateRandomString
*
*  Purpose : Generate Random String for reference purpose
*
*    Input : n int - size of the returning string
*
*	 Return : string - securely generated random string
*			  error - if happened, nil otherwise

func GenerateRandomStringURLSafe

func GenerateRandomStringURLSafe(n int) (string, error)

***************************************************************************************

*
* Function : GenerateRandomStringURLSafe
*
*  Purpose : Generate URL-safe, base64 encoded random string
*
*    Input : n int - size of the returning string
*
*	 Return : string - securely generated random bytes
*			  error - if happened, nil otherwise

func GetGoID

func GetGoID() int

***************************************************************************************

*
* Function : GetGoID
*
*  Purpose : Get ID of gorutine
*
*   Input : Nothing
*
*  Return : Return ID in int format

func Implode added in v0.2.0

func Implode(array []string, separator ...byte) string

***************************************************************************************

*
* Function : Implode
*
*  Purpose : Convert string array to one line with separators
*
*    Input : array []string - income string
*			  separator ...byte - set separator if need it (',' by default)
*
*	 Return : string

Types

This section is empty.

Jump to

Keyboard shortcuts

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