Documentation ¶
Index ¶
- func InTransaction(db *gorm.DB) bool
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsRecordNotFound(err error) bool
- func ReverseSlice(data interface{})
- func Sha256Hash2String(p []byte) (string, error)
- func SubStrFromTo(s string, from, to int) string
- func SubStrFromToEnd(s string, from int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InTransaction ¶
InTransaction is used check whether current db is in transaction
func IsRecordNotFound ¶
IsRecordNotFound is used to determine that some error is RecordNotFound. when we use gorm to find models, if there are not related records, an error "record not found" will be returned.
func Sha256Hash2String ¶
Sha256Hash2String will hash bytes to string, if some errors happened, an error will be returned.
func SubStrFromTo ¶
SubStrFromTo will truncate the specific string by parameters
func SubStrFromToEnd ¶
SubStrFromToEnd will truncate the specific string by parameters
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.