Documentation ¶
Overview ¶
Package utils is a collection of helpful utilities for common actions within GoLang development
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CorsHandler ¶
func CorsHandler provides an *extremely* broad Cors handler for development Not suitable for production use, as origin, method, and headers should all be more extensively restricted for a production environment
func GenerateSlug ¶
GenerateSlug converts a string into a lowercase dasherized slug
For example: GenerateSlug("My cool object") returns "my-cool-object"
func InChain ¶
InChain returns a boolean if a string is already in a slice of strings
[TODO] Extend this to work for all standard types
Types ¶
type ApiResponse ¶
type ApiResponse struct { Code int `json:"code"` Message string `json:"message"` Result interface{} `json:"result"` Data map[string]interface{} `json:"data"` // Generic extra data to be sent along in response }
type ApiResponse is a generic API response struct
Click to show internal directories.
Click to hide internal directories.