Documentation ¶
Index ¶
- func GenerateSessionKey() (string, error)
- func GetBearer(r *http.Request) string
- func GetInt32FromPath(r *http.Request, key string) (int32, error)
- func GetInt32FromQuery(r *http.Request, key string, defaultValue int32) int32
- func GetPagination(limit, page int32) (newLimit, offset int)
- func GetSessionFromContext(ctx context.Context) *entity.Session
- func GetUserIDFromContext(ctx context.Context) int32
- func HashBcrypt(password string) (string, error)
- func HashBcryptCompare(password, hash string) bool
- func HashSha256(data string) string
- func ParseJsonFromHTTPRequest(r io.ReadCloser, data interface{}) error
- func PrepareStringToLike(s string) string
- func Response(w http.ResponseWriter, respBody interface{}) error
- func ResponseWithMeta(w http.ResponseWriter, respBody interface{}, meta *Meta) error
- func UUIDGenerate() (string, error)
- type JSONResponse
- type Meta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSessionKey ¶
func GetInt32FromQuery ¶
func GetPagination ¶
func GetUserIDFromContext ¶
func HashBcrypt ¶
func HashBcryptCompare ¶
func HashSha256 ¶
func ParseJsonFromHTTPRequest ¶
func ParseJsonFromHTTPRequest(r io.ReadCloser, data interface{}) error
func PrepareStringToLike ¶
func Response ¶
func Response(w http.ResponseWriter, respBody interface{}) error
func ResponseWithMeta ¶
func ResponseWithMeta(w http.ResponseWriter, respBody interface{}, meta *Meta) error
func UUIDGenerate ¶
Types ¶
type JSONResponse ¶
type JSONResponse struct { // Body Data interface{} `json:"data,omitempty"` // Meta Meta *Meta `json:"meta,omitempty"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.