Documentation ¶
Index ¶
- func ArrayFind(slice []string, val string) (int, bool)
- func GenerateNatsResponse(status int, msg *nats.Msg, data interface{}, meta *models.Metadata)
- func GinGenerateResponse(status int, c *gin.Context, data interface{}, meta *models.Metadata)
- func IndexOfString(element string, data []string) int
- func IsInArray(slice []string, val string) bool
- func RunTransaction(db *gorm.DB, fn txnFunc) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayFind ¶
ArrayFind takes a slice and looks for an element in it. If found it will return it's key, otherwise it will return -1 and a bool of false.
func GenerateNatsResponse ¶
GenerateNatsResponse builds responses for nats requests
func GinGenerateResponse ¶
GinGenerateResponse generates a response for the api
func IndexOfString ¶
IndexOfString finds the index of an item in a string array. This is case insensitive and returns -1 if not found
func IsInArray ¶
IsInArray takes a slice and looks for an element in it. If found it will return it's key, otherwise it will return -1 and a bool of false.
func RunTransaction ¶
RunTransaction is a wrapper for a transaction. This automatically re-calls `fn` with the open transaction as an argument as long as the database server asks for the transaction to be retried.
Types ¶
This section is empty.