Documentation
¶
Index ¶
- func AESEncrypt(text string, key []byte) string
- func GormOpen(driver string) *gorm.DB
- func InArray(needle string, haystack []interface{}) bool
- func JSONEncode(data interface{}) string
- func LogIfError(err error, message string)
- func NewECBEncrypter(b cipher.Block) cipher.BlockMode
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func RandomInteger(min int, max int) int
- func RandomString(length int) string
- func ToDateTimeString(dateTime time.Time) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AESEncrypt ¶ added in v1.0.7
AESEncrypt encrypts text using cipher AES/ECB/PKCS5PADDING
func JSONEncode ¶ added in v1.0.5
func JSONEncode(data interface{}) string
JSONEncode converts data into JSON string
func LogIfError ¶ added in v1.0.4
LogIfError logs the error with message
func NewECBEncrypter ¶ added in v1.0.7
NewECBEncrypter returns a BlockMode which encrypts in ecb mode, using the given Block
func PKCS5Padding ¶ added in v1.0.7
PKCS5Padding adds PKCS5 padding
func RandomInteger ¶ added in v1.0.4
RandomInteger returns random integer between parameters
func RandomString ¶ added in v1.0.4
RandomString generates random string with custom length
func ToDateTimeString ¶
ToDateTimeString converts DateTime into string with Y-m-d H:i:s format
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.